Skip to content

Merge content script UI functions #273

Closed

Description

@aklinker1

I want to add a helper function for integrated UIs, similar to createContentScriptUi and createContentScriptIframe, but I'm recognizing that adding a third function would be confusing and that the API reference is hard to follow because of how I've constructed the options type.

So I think I'm going to simplify all that into a single function with a basic type for the options. Something like this:

export function createContentScriptUi(
  options: {
    mode?: "integrated" | "shadow-root" | "iframe",
    position?: "inline" | "overlay" | "modal",
    zIndex?: number;
    anchor?: string | Element;
    alignment?: "top-left" | "top-right" | "bottom-right" | "bottom-left";
    page?: string;
    css?: string;
    name?: string;
    mount?(container: Element): TApp;
    onRemove?(app: TApp): void;
  },
): ContentScriptUi;

Originally posted by @aklinker1 in #267 (comment)

Activity

  1. added this to the v1.0 milestone on Dec 30, 2023
  2. aklinker1 commented on Jan 11, 2024

    @aklinker1
    MemberAuthor

    See #333 (comment).

    I've decided to keep the functions as separate, but I've renamed them to better represent how the functions create the UIs.

    • createContentScriptUi → createIntegratedUi
    • createContentScriptIframe → createShadowRootUi
    • createIframeUi (new)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions