diff --git a/apps/content/src/browser/browser.js b/apps/content/src/browser/browser.js index a42b5bd..98aff99 100644 --- a/apps/content/src/browser/browser.js +++ b/apps/content/src/browser/browser.js @@ -4,8 +4,26 @@ // @ts-check import BrowserWindow from './BrowserWindow.svelte' import './browser.css' +import * as WindowTabs from './windowApi/WindowTabs.js' import { registerEventBus } from './windowApi/eventBus.js' +// Handle window arguments +let rawArgs = window.arguments && window.arguments[0] +/** @type {Record} */ +let args = {} + +if (rawArgs && rawArgs instanceof Ci.nsISupports) { + args = rawArgs.wrappedJSObject || {} +} else if (rawArgs) { + args = rawArgs +} + +const initialUrls = args.initialUrl + ? [args.initialUrl] + : ['https://google.com/', 'https://svelte.dev/'] + +WindowTabs.initialize(initialUrls) + registerEventBus() new BrowserWindow({ target: document.body }) diff --git a/apps/content/src/browser/components/PageAction.svelte b/apps/content/src/browser/components/PageAction.svelte index 1cc455e..e943f67 100644 --- a/apps/content/src/browser/components/PageAction.svelte +++ b/apps/content/src/browser/components/PageAction.svelte @@ -12,9 +12,15 @@ /** @type {import('resource://app/modules/EPageActions.sys.mjs').PageActionImpl} */ export let pageAction + /** @type {number} */ + export let browserViewId const view = PageActionApi.setup(pageAction) const icons = PageActionApi.getIcons(view) + const extensionId = pageAction.extensionId + .replace('@', '') + .replace('}', '') + .replace('{', '') const trigger = view.trigger const panel = view.panel @@ -45,7 +51,11 @@ }) - + {#if $icons} {:else} @@ -54,7 +64,11 @@ {#if pageAction.popupUrl} - + {/if}