diff --git a/.eslintrc.json b/.eslintrc.json index c5033c6..548dc49 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -27,14 +27,14 @@ } }, { - "files": ["ext/**/*.svelte"], + "files": ["extension/**/*.svelte"], "processor": "svelte3/svelte3", "rules": { "no-undef": "off" } }, { - "files": ["**/*.ts", "ext/**/*.svelte"], + "files": ["**/*.ts", "extension/**/*.svelte"], "extends": "plugin:@typescript-eslint/recommended", "rules": { "@typescript-eslint/no-empty-interface": "error", diff --git a/.gitignore b/.gitignore index c1ebd96..3c03aef 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ node_modules/ dist/ bridge/node_modules/ bridge/build -ext/node_modules/ +extension/node_modules/ test/ChromeProfile/ .idea/ *.iml diff --git a/IMPLEMENTATION.md b/IMPLEMENTATION.md index f912607..c4c7e2f 100644 --- a/IMPLEMENTATION.md +++ b/IMPLEMENTATION.md @@ -13,11 +13,11 @@ interface Message { } ``` -The message payloads are all fully-typed and defined in [`ext/src/messaging.ts`](./ext/src/messaging.ts). Wrappers around both WebExtension messaging and MessagePort APIs are used to provide type checking based on these message definitions. Almost all messages are sent via messaging connections, rather than one-off `sendMessage`/`postMessage` calls. +The message payloads are all fully-typed and defined in [`extension/src/messaging.ts`](./extension/src/messaging.ts). Wrappers around both WebExtension messaging and MessagePort APIs are used to provide type checking based on these message definitions. Almost all messages are sent via messaging connections, rather than one-off `sendMessage`/`postMessage` calls. ## Cast Instances -A cast instance is an initialized Web Sender SDK instance with the extension components that handle communication with receiver devices and other required functionality (like receiver selection) and is managed by the [Cast Manager](./ext/src/background/castManager.ts) background script module. +A cast instance is an initialized Web Sender SDK instance with the extension components that handle communication with receiver devices and other required functionality (like receiver selection) and is managed by the [Cast Manager](./extension/src/background/castManager.ts) background script module. Only the [Base API](https://web.archive.org/web/20150318065431/https://developers.google.com/cast/docs/chrome_sender) (`chrome.cast`) is implemented, since the Framework API (`chrome.cast.framework`) is a wrapper around the Base API and doesn't require any extra functionality on the extension-side. @@ -25,7 +25,7 @@ For some background, see [Cast SDK terminology](https://developers.google.com/ca ### Communication -SDK instances send messages through a MessageChannel managed by the [`pageMessaging`](./ext/src/cast/pageMessaging.ts) module. One side listens for an initialization message containing a MessagePort, then receives messages from the SDK on that port and calls its message listeners so that they can be forwarded to the Cast Manager. The other side sends that initialization message and handles responses back from the Cast Manager. +SDK instances send messages through a MessageChannel managed by the [`pageMessaging`](./extension/src/cast/pageMessaging.ts) module. One side listens for an initialization message containing a MessagePort, then receives messages from the SDK on that port and calls its message listeners so that they can be forwarded to the Cast Manager. The other side sends that initialization message and handles responses back from the Cast Manager. ### Initialization @@ -40,9 +40,9 @@ This points to a loader script that checks the user agent string before injectin For an instance created for a page script SDK: -1. The [`contentInitial.ts`](./ext/src/cast/contentInitial.ts) content script is run at document start and handles some compatibility issues that can't be addressed via extension APIs (like SDK scripts directly loaded from `chrome-extension://` URLs). +1. The [`contentInitial.ts`](./extension/src/cast/contentInitial.ts) content script is run at document start and handles some compatibility issues that can't be addressed via extension APIs (like SDK scripts directly loaded from `chrome-extension://` URLs). 2. The page loads the SDK via the usual Google-hosted `cast_sender.js` loader script. -3. The extension intercepts this script load, injects the [`contentBridge.ts`](./ext/src/cast/contentBridge.ts) script that creates a messaging connection to the Cast Manager (via extension messaging) that registers an instance for that context, and waits for a page messaging connection to forward messages through (as described [here](#communication)). The initial request is then transparently redirected to the extension-hosted SDK page script at [`src/cast/content.ts`](./src/cast/content.ts). +3. The extension intercepts this script load, injects the [`contentBridge.ts`](./extension/src/cast/contentBridge.ts) script that creates a messaging connection to the Cast Manager (via extension messaging) that registers an instance for that context, and waits for a page messaging connection to forward messages through (as described [here](#communication)). The initial request is then transparently redirected to the extension-hosted SDK page script at [`src/cast/content.ts`](./src/cast/content.ts). 4. The SDK page script then creates the SDK objects ([`window.chrome.cast`](https://developers.google.com/cast/docs/reference/web_sender/chrome.cast)), handles loading the Framework API (if requested) and adds a page messaging listener for `cast:instanceCreated` events. 5. The Cast Manager sends a `cast:instanceCreated` message to the SDK, which then calls the sender app's entry handler ([`window.__onGCastApiAvailable`](https://developers.google.com/cast/docs/web_sender/integrate#initialization)). @@ -50,7 +50,7 @@ For an instance created for a page script SDK: For an instance created for an extension script: -1. The extension script imports the [`cast/export.ts`](./ext/src/cast/export.ts) module which creates an SDK instance. Page messaging is still used to communicate with the SDK, despite the lack of a script context boundary to avoid complicating the SDK implementation. +1. The extension script imports the [`cast/export.ts`](./extension/src/cast/export.ts) module which creates an SDK instance. Page messaging is still used to communicate with the SDK, despite the lack of a script context boundary to avoid complicating the SDK implementation. 2. The extension script calls the exported `ensureInit` async function. Depending on the extension script context: - If **background**: The Cast Manager is called directly, registering a new cast instance, providing it with a port for a newly-created message channel (since extension messaging is only supported between contexts). Page messaging is hooked up such that messages from the SDK are sent to the Cast Manager through this channel and vice versa. diff --git a/README.md b/README.md index 6d93b8f..af9e353 100644 --- a/README.md +++ b/README.md @@ -97,19 +97,19 @@ This will build the extension and bridge, outputting to `dist/`: - `dist/bridge/` ... contains the built bridge with launcher script and manifest (with the path pointing that script). The `install-manifest` npm script copies this manifest to the proper location (or adds its current location to the registry on Windows). -- `dist/ext/` +- `dist/extension/` ... contains the unpacked extension. -Watching ext changes: +Watching extension changes: ```sh -$ npm run watch:ext +$ npm run watch:extension ``` Launch Firefox with built extension (run in separate terminal): ```sh -$ npm run start:ext +$ npm run start:extension ``` #### 32-bit on Windows @@ -128,7 +128,7 @@ $ npm run package:bridge -- -- --arch=x86 ### Build scripts -Extension build script (`build:ext`) arguments: +Extension build script (`build:extension`) arguments: - `--watch` Rebuild on changes. Incompatible with `--package`. @@ -164,13 +164,13 @@ $ npm run package - `dist/bridge/` ... contains the installer package: `fx_cast_bridge--.(pkg|deb|rpm|exe)` -- `dist/ext/` +- `dist/extension/` ... contains the built extension archive: `fx_cast-.xpi`. Packaging examples: ```sh -$ npm run package:ext # Packaging extension +$ npm run package:extension # Packaging extension $ npm run package:bridge # Packaging bridge application # Linux platforms @@ -182,14 +182,14 @@ $ npm run package:bridge -- -- --package-type=rpm Testing requires geckodriver (or chromedriver for Chrome parity testing). See [selenium-webdriver](https://www.npmjs.com/package/selenium-webdriver#installation) installation instructions (ignore `npm install`). -The test script expects a compatible installed bridge version and a packaged extension archive at `dist/ext/`. +The test script expects a compatible installed bridge version and a packaged extension archive at `dist/extension/`. Test results will be displayed in the terminal and within the opened browser tab. Chrome may take some time to initialize the media router component before the cast API is available for testing. ```sh $ npm run build:bridge $ npm run install-manifest -$ npm run package:ext +$ npm run package:extension $ npm test # Or if testing in Chrome @@ -207,9 +207,9 @@ These are somewhat outdated now, but show the basic function of the extension: - [electron-chromecast](https://github.com/GPMDP/electron-chromecast)[^electron] - Icons by [icons8](https://icons8.com/): - - `ext/src/ui/options/assets/icons8-cancel-120.png` - - `ext/src/ui/options/assets/icons8-ok-120.png` - - `ext/src/ui/options/assets/icons8-warn-120.png` + - `extension/src/ui/options/assets/icons8-cancel-120.png` + - `extension/src/ui/options/assets/icons8-ok-120.png` + - `extension/src/ui/options/assets/icons8-warn-120.png` ## Donations diff --git a/bridge/src/bridge/messaging.ts b/bridge/src/bridge/messaging.ts index 872e2d6..7730f3c 100644 --- a/bridge/src/bridge/messaging.ts +++ b/bridge/src/bridge/messaging.ts @@ -19,7 +19,7 @@ import type { * IMPORTANT: * Messages that cross the native messaging channel. MUST keep * in-sync with the extension's version at: - * ext/src/messaging.ts > AppMessageDefinitions + * extension/src/messaging.ts > AppMessageDefinitions */ type MessageDefinitions = { /** diff --git a/ext/.eslintrc.json b/extension/.eslintrc.json similarity index 100% rename from ext/.eslintrc.json rename to extension/.eslintrc.json diff --git a/ext/bin/build.js b/extension/bin/build.js similarity index 98% rename from ext/bin/build.js rename to extension/bin/build.js index f3458c7..c59d496 100644 --- a/ext/bin/build.js +++ b/extension/bin/build.js @@ -47,7 +47,7 @@ const __dirname = path.dirname(url.fileURLToPath(import.meta.url)); const rootPath = path.join(__dirname, "../"); const srcPath = path.join(rootPath, "src"); -const distPath = path.join(rootPath, "../dist/ext/"); +const distPath = path.join(rootPath, "../dist/extension/"); const unpackedPath = path.join(distPath, "unpacked"); const outPath = argv.package ? unpackedPath : distPath; diff --git a/ext/bin/lib/copyFilesPlugin.js b/extension/bin/lib/copyFilesPlugin.js similarity index 100% rename from ext/bin/lib/copyFilesPlugin.js rename to extension/bin/lib/copyFilesPlugin.js diff --git a/ext/package-lock.json b/extension/package-lock.json similarity index 99% rename from ext/package-lock.json rename to extension/package-lock.json index 4ce7ada..6643a89 100644 --- a/ext/package-lock.json +++ b/extension/package-lock.json @@ -1,5 +1,5 @@ { - "name": "ext", + "name": "extension", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/ext/package.json b/extension/package.json similarity index 93% rename from ext/package.json rename to extension/package.json index 10c0c0f..7458409 100644 --- a/ext/package.json +++ b/extension/package.json @@ -4,7 +4,7 @@ "build": "node bin/build.js", "package": "node bin/build.js --package", "watch": "node bin/build.js --watch", - "start": "web-ext run -s ../dist/ext/", + "start": "web-ext run -s ../dist/extension/", "lint": "eslint src --ext .ts,.tsx" }, "devDependencies": { diff --git a/ext/src/_locales/de/messages.json b/extension/src/_locales/de/messages.json similarity index 100% rename from ext/src/_locales/de/messages.json rename to extension/src/_locales/de/messages.json diff --git a/ext/src/_locales/en/messages.json b/extension/src/_locales/en/messages.json similarity index 100% rename from ext/src/_locales/en/messages.json rename to extension/src/_locales/en/messages.json diff --git a/ext/src/_locales/es/messages.json b/extension/src/_locales/es/messages.json similarity index 100% rename from ext/src/_locales/es/messages.json rename to extension/src/_locales/es/messages.json diff --git a/ext/src/_locales/id/messages.json b/extension/src/_locales/id/messages.json similarity index 100% rename from ext/src/_locales/id/messages.json rename to extension/src/_locales/id/messages.json diff --git a/ext/src/_locales/it/messages.json b/extension/src/_locales/it/messages.json similarity index 100% rename from ext/src/_locales/it/messages.json rename to extension/src/_locales/it/messages.json diff --git a/ext/src/_locales/nl/messages.json b/extension/src/_locales/nl/messages.json similarity index 100% rename from ext/src/_locales/nl/messages.json rename to extension/src/_locales/nl/messages.json diff --git a/ext/src/_locales/no/messages.json b/extension/src/_locales/no/messages.json similarity index 100% rename from ext/src/_locales/no/messages.json rename to extension/src/_locales/no/messages.json diff --git a/ext/src/background/ReceiverSelector.ts b/extension/src/background/ReceiverSelector.ts similarity index 100% rename from ext/src/background/ReceiverSelector.ts rename to extension/src/background/ReceiverSelector.ts diff --git a/ext/src/background/action.ts b/extension/src/background/action.ts similarity index 100% rename from ext/src/background/action.ts rename to extension/src/background/action.ts diff --git a/ext/src/background/background.ts b/extension/src/background/background.ts similarity index 100% rename from ext/src/background/background.ts rename to extension/src/background/background.ts diff --git a/ext/src/background/castManager.ts b/extension/src/background/castManager.ts similarity index 100% rename from ext/src/background/castManager.ts rename to extension/src/background/castManager.ts diff --git a/ext/src/background/deviceManager.ts b/extension/src/background/deviceManager.ts similarity index 100% rename from ext/src/background/deviceManager.ts rename to extension/src/background/deviceManager.ts diff --git a/ext/src/background/menus.ts b/extension/src/background/menus.ts similarity index 100% rename from ext/src/background/menus.ts rename to extension/src/background/menus.ts diff --git a/ext/src/background/whitelist.ts b/extension/src/background/whitelist.ts similarity index 100% rename from ext/src/background/whitelist.ts rename to extension/src/background/whitelist.ts diff --git a/ext/src/cast/content.ts b/extension/src/cast/content.ts similarity index 100% rename from ext/src/cast/content.ts rename to extension/src/cast/content.ts diff --git a/ext/src/cast/contentBridge.ts b/extension/src/cast/contentBridge.ts similarity index 100% rename from ext/src/cast/contentBridge.ts rename to extension/src/cast/contentBridge.ts diff --git a/ext/src/cast/contentInitial.ts b/extension/src/cast/contentInitial.ts similarity index 100% rename from ext/src/cast/contentInitial.ts rename to extension/src/cast/contentInitial.ts diff --git a/ext/src/cast/export.ts b/extension/src/cast/export.ts similarity index 100% rename from ext/src/cast/export.ts rename to extension/src/cast/export.ts diff --git a/ext/src/cast/knownApps.ts b/extension/src/cast/knownApps.ts similarity index 100% rename from ext/src/cast/knownApps.ts rename to extension/src/cast/knownApps.ts diff --git a/ext/src/cast/pageMessaging.ts b/extension/src/cast/pageMessaging.ts similarity index 100% rename from ext/src/cast/pageMessaging.ts rename to extension/src/cast/pageMessaging.ts diff --git a/ext/src/cast/sdk/Session.ts b/extension/src/cast/sdk/Session.ts similarity index 100% rename from ext/src/cast/sdk/Session.ts rename to extension/src/cast/sdk/Session.ts diff --git a/ext/src/cast/sdk/classes.ts b/extension/src/cast/sdk/classes.ts similarity index 100% rename from ext/src/cast/sdk/classes.ts rename to extension/src/cast/sdk/classes.ts diff --git a/ext/src/cast/sdk/enums.ts b/extension/src/cast/sdk/enums.ts similarity index 100% rename from ext/src/cast/sdk/enums.ts rename to extension/src/cast/sdk/enums.ts diff --git a/ext/src/cast/sdk/index.ts b/extension/src/cast/sdk/index.ts similarity index 100% rename from ext/src/cast/sdk/index.ts rename to extension/src/cast/sdk/index.ts diff --git a/ext/src/cast/sdk/media/Media.ts b/extension/src/cast/sdk/media/Media.ts similarity index 100% rename from ext/src/cast/sdk/media/Media.ts rename to extension/src/cast/sdk/media/Media.ts diff --git a/ext/src/cast/sdk/media/classes.ts b/extension/src/cast/sdk/media/classes.ts similarity index 100% rename from ext/src/cast/sdk/media/classes.ts rename to extension/src/cast/sdk/media/classes.ts diff --git a/ext/src/cast/sdk/media/enums.ts b/extension/src/cast/sdk/media/enums.ts similarity index 100% rename from ext/src/cast/sdk/media/enums.ts rename to extension/src/cast/sdk/media/enums.ts diff --git a/ext/src/cast/sdk/media/index.ts b/extension/src/cast/sdk/media/index.ts similarity index 100% rename from ext/src/cast/sdk/media/index.ts rename to extension/src/cast/sdk/media/index.ts diff --git a/ext/src/cast/sdk/types.ts b/extension/src/cast/sdk/types.ts similarity index 100% rename from ext/src/cast/sdk/types.ts rename to extension/src/cast/sdk/types.ts diff --git a/ext/src/cast/senders/media.ts b/extension/src/cast/senders/media.ts similarity index 100% rename from ext/src/cast/senders/media.ts rename to extension/src/cast/senders/media.ts diff --git a/ext/src/cast/senders/mirroring.ts b/extension/src/cast/senders/mirroring.ts similarity index 100% rename from ext/src/cast/senders/mirroring.ts rename to extension/src/cast/senders/mirroring.ts diff --git a/ext/src/cast/urls.ts b/extension/src/cast/urls.ts similarity index 100% rename from ext/src/cast/urls.ts rename to extension/src/cast/urls.ts diff --git a/ext/src/cast/utils.ts b/extension/src/cast/utils.ts similarity index 100% rename from ext/src/cast/utils.ts rename to extension/src/cast/utils.ts diff --git a/ext/src/defaultOptions.ts b/extension/src/defaultOptions.ts similarity index 100% rename from ext/src/defaultOptions.ts rename to extension/src/defaultOptions.ts diff --git a/ext/src/global.d.ts b/extension/src/global.d.ts similarity index 100% rename from ext/src/global.d.ts rename to extension/src/global.d.ts diff --git a/ext/src/icons/AirPlay_Audio.svg b/extension/src/icons/AirPlay_Audio.svg similarity index 100% rename from ext/src/icons/AirPlay_Audio.svg rename to extension/src/icons/AirPlay_Audio.svg diff --git a/ext/src/icons/AirPlay_Video.svg b/extension/src/icons/AirPlay_Video.svg similarity index 100% rename from ext/src/icons/AirPlay_Video.svg rename to extension/src/icons/AirPlay_Video.svg diff --git a/ext/src/icons/cast-connected.svg b/extension/src/icons/cast-connected.svg similarity index 100% rename from ext/src/icons/cast-connected.svg rename to extension/src/icons/cast-connected.svg diff --git a/ext/src/icons/cast-connecting-dark.svg b/extension/src/icons/cast-connecting-dark.svg similarity index 100% rename from ext/src/icons/cast-connecting-dark.svg rename to extension/src/icons/cast-connecting-dark.svg diff --git a/ext/src/icons/cast-connecting-light.svg b/extension/src/icons/cast-connecting-light.svg similarity index 100% rename from ext/src/icons/cast-connecting-light.svg rename to extension/src/icons/cast-connecting-light.svg diff --git a/ext/src/icons/cast-default-dark.svg b/extension/src/icons/cast-default-dark.svg similarity index 100% rename from ext/src/icons/cast-default-dark.svg rename to extension/src/icons/cast-default-dark.svg diff --git a/ext/src/icons/cast-default-light.svg b/extension/src/icons/cast-default-light.svg similarity index 100% rename from ext/src/icons/cast-default-light.svg rename to extension/src/icons/cast-default-light.svg diff --git a/ext/src/icons/icon.svg b/extension/src/icons/icon.svg similarity index 100% rename from ext/src/icons/icon.svg rename to extension/src/icons/icon.svg diff --git a/ext/src/lib/TypedEventTarget.ts b/extension/src/lib/TypedEventTarget.ts similarity index 100% rename from ext/src/lib/TypedEventTarget.ts rename to extension/src/lib/TypedEventTarget.ts diff --git a/ext/src/lib/TypedMessagePort.ts b/extension/src/lib/TypedMessagePort.ts similarity index 100% rename from ext/src/lib/TypedMessagePort.ts rename to extension/src/lib/TypedMessagePort.ts diff --git a/ext/src/lib/TypedPort.ts b/extension/src/lib/TypedPort.ts similarity index 100% rename from ext/src/lib/TypedPort.ts rename to extension/src/lib/TypedPort.ts diff --git a/ext/src/lib/TypedStorageArea.ts b/extension/src/lib/TypedStorageArea.ts similarity index 100% rename from ext/src/lib/TypedStorageArea.ts rename to extension/src/lib/TypedStorageArea.ts diff --git a/ext/src/lib/bridge.ts b/extension/src/lib/bridge.ts similarity index 100% rename from ext/src/lib/bridge.ts rename to extension/src/lib/bridge.ts diff --git a/ext/src/lib/chromecastConfigApi.ts b/extension/src/lib/chromecastConfigApi.ts similarity index 100% rename from ext/src/lib/chromecastConfigApi.ts rename to extension/src/lib/chromecastConfigApi.ts diff --git a/ext/src/lib/logger.ts b/extension/src/lib/logger.ts similarity index 100% rename from ext/src/lib/logger.ts rename to extension/src/lib/logger.ts diff --git a/ext/src/lib/matchPattern.ts b/extension/src/lib/matchPattern.ts similarity index 100% rename from ext/src/lib/matchPattern.ts rename to extension/src/lib/matchPattern.ts diff --git a/ext/src/lib/nativeMessaging.ts b/extension/src/lib/nativeMessaging.ts similarity index 100% rename from ext/src/lib/nativeMessaging.ts rename to extension/src/lib/nativeMessaging.ts diff --git a/ext/src/lib/options.ts b/extension/src/lib/options.ts similarity index 100% rename from ext/src/lib/options.ts rename to extension/src/lib/options.ts diff --git a/ext/src/lib/userAgents.ts b/extension/src/lib/userAgents.ts similarity index 100% rename from ext/src/lib/userAgents.ts rename to extension/src/lib/userAgents.ts diff --git a/ext/src/lib/utils.ts b/extension/src/lib/utils.ts similarity index 100% rename from ext/src/lib/utils.ts rename to extension/src/lib/utils.ts diff --git a/ext/src/manifest.json b/extension/src/manifest.json similarity index 100% rename from ext/src/manifest.json rename to extension/src/manifest.json diff --git a/ext/src/menuIds.ts b/extension/src/menuIds.ts similarity index 100% rename from ext/src/menuIds.ts rename to extension/src/menuIds.ts diff --git a/ext/src/messaging.ts b/extension/src/messaging.ts similarity index 98% rename from ext/src/messaging.ts rename to extension/src/messaging.ts index 817ef30..6d3be5d 100644 --- a/ext/src/messaging.ts +++ b/extension/src/messaging.ts @@ -41,7 +41,7 @@ import type { ReceiverAction } from "./cast/sdk/enums"; * Messages exclusively used internally between extension * components. */ -type ExtMessageDefinitions = { +type ExtensionMessageDefinitions = { /** Initial data to send to selector popup. */ "popup:init": { appInfo?: ReceiverSelectorAppInfo; @@ -125,7 +125,7 @@ type ExtMessageDefinitions = { * in-sync with the bridge's version at: * app/src/bridge/messaging.ts > MessageDefinitions */ -type AppMessageDefinitions = { +type BridgeMessageDefinitions = { /** * First message sent by the extension to the bridge. * Includes extension version string. Responds directly with version @@ -297,7 +297,8 @@ type AppMessageDefinitions = { "mediaCast:mediaServerError": string; }; -type MessageDefinitions = ExtMessageDefinitions & AppMessageDefinitions; +type MessageDefinitions = ExtensionMessageDefinitions & + BridgeMessageDefinitions; interface MessageBase { subject: K; diff --git a/ext/src/types.ts b/extension/src/types.ts similarity index 100% rename from ext/src/types.ts rename to extension/src/types.ts diff --git a/ext/src/ui/LoadingIndicator.svelte b/extension/src/ui/LoadingIndicator.svelte similarity index 100% rename from ext/src/ui/LoadingIndicator.svelte rename to extension/src/ui/LoadingIndicator.svelte diff --git a/ext/src/ui/assets/photon_arrowhead_down.svg b/extension/src/ui/assets/photon_arrowhead_down.svg similarity index 100% rename from ext/src/ui/assets/photon_arrowhead_down.svg rename to extension/src/ui/assets/photon_arrowhead_down.svg diff --git a/ext/src/ui/assets/photon_arrowhead_up.svg b/extension/src/ui/assets/photon_arrowhead_up.svg similarity index 100% rename from ext/src/ui/assets/photon_arrowhead_up.svg rename to extension/src/ui/assets/photon_arrowhead_up.svg diff --git a/ext/src/ui/assets/photon_cancel.svg b/extension/src/ui/assets/photon_cancel.svg similarity index 100% rename from ext/src/ui/assets/photon_cancel.svg rename to extension/src/ui/assets/photon_cancel.svg diff --git a/ext/src/ui/assets/photon_info.svg b/extension/src/ui/assets/photon_info.svg similarity index 100% rename from ext/src/ui/assets/photon_info.svg rename to extension/src/ui/assets/photon_info.svg diff --git a/ext/src/ui/assets/photon_warning.svg b/extension/src/ui/assets/photon_warning.svg similarity index 100% rename from ext/src/ui/assets/photon_warning.svg rename to extension/src/ui/assets/photon_warning.svg diff --git a/ext/src/ui/mirroring/MirroringPopup.svelte b/extension/src/ui/mirroring/MirroringPopup.svelte similarity index 100% rename from ext/src/ui/mirroring/MirroringPopup.svelte rename to extension/src/ui/mirroring/MirroringPopup.svelte diff --git a/ext/src/ui/mirroring/index.html b/extension/src/ui/mirroring/index.html similarity index 100% rename from ext/src/ui/mirroring/index.html rename to extension/src/ui/mirroring/index.html diff --git a/ext/src/ui/mirroring/index.ts b/extension/src/ui/mirroring/index.ts similarity index 100% rename from ext/src/ui/mirroring/index.ts rename to extension/src/ui/mirroring/index.ts diff --git a/ext/src/ui/mirroring/style.css b/extension/src/ui/mirroring/style.css similarity index 100% rename from ext/src/ui/mirroring/style.css rename to extension/src/ui/mirroring/style.css diff --git a/ext/src/ui/options/Bridge.svelte b/extension/src/ui/options/Bridge.svelte similarity index 100% rename from ext/src/ui/options/Bridge.svelte rename to extension/src/ui/options/Bridge.svelte diff --git a/ext/src/ui/options/Options.svelte b/extension/src/ui/options/Options.svelte similarity index 100% rename from ext/src/ui/options/Options.svelte rename to extension/src/ui/options/Options.svelte diff --git a/ext/src/ui/options/Whitelist.svelte b/extension/src/ui/options/Whitelist.svelte similarity index 100% rename from ext/src/ui/options/Whitelist.svelte rename to extension/src/ui/options/Whitelist.svelte diff --git a/ext/src/ui/options/assets/icons8-cancel-120.png b/extension/src/ui/options/assets/icons8-cancel-120.png similarity index 100% rename from ext/src/ui/options/assets/icons8-cancel-120.png rename to extension/src/ui/options/assets/icons8-cancel-120.png diff --git a/ext/src/ui/options/assets/icons8-ok-120.png b/extension/src/ui/options/assets/icons8-ok-120.png similarity index 100% rename from ext/src/ui/options/assets/icons8-ok-120.png rename to extension/src/ui/options/assets/icons8-ok-120.png diff --git a/ext/src/ui/options/assets/icons8-warn-120.png b/extension/src/ui/options/assets/icons8-warn-120.png similarity index 100% rename from ext/src/ui/options/assets/icons8-warn-120.png rename to extension/src/ui/options/assets/icons8-warn-120.png diff --git a/ext/src/ui/options/assets/photon_delete.svg b/extension/src/ui/options/assets/photon_delete.svg similarity index 100% rename from ext/src/ui/options/assets/photon_delete.svg rename to extension/src/ui/options/assets/photon_delete.svg diff --git a/ext/src/ui/options/assets/photon_edit.svg b/extension/src/ui/options/assets/photon_edit.svg similarity index 100% rename from ext/src/ui/options/assets/photon_edit.svg rename to extension/src/ui/options/assets/photon_edit.svg diff --git a/ext/src/ui/options/assets/photon_new.svg b/extension/src/ui/options/assets/photon_new.svg similarity index 100% rename from ext/src/ui/options/assets/photon_new.svg rename to extension/src/ui/options/assets/photon_new.svg diff --git a/ext/src/ui/options/assets/photon_refresh.svg b/extension/src/ui/options/assets/photon_refresh.svg similarity index 100% rename from ext/src/ui/options/assets/photon_refresh.svg rename to extension/src/ui/options/assets/photon_refresh.svg diff --git a/ext/src/ui/options/index.html b/extension/src/ui/options/index.html similarity index 100% rename from ext/src/ui/options/index.html rename to extension/src/ui/options/index.html diff --git a/ext/src/ui/options/index.ts b/extension/src/ui/options/index.ts similarity index 100% rename from ext/src/ui/options/index.ts rename to extension/src/ui/options/index.ts diff --git a/ext/src/ui/options/styles/index.css b/extension/src/ui/options/styles/index.css similarity index 100% rename from ext/src/ui/options/styles/index.css rename to extension/src/ui/options/styles/index.css diff --git a/ext/src/ui/options/styles/mac.css b/extension/src/ui/options/styles/mac.css similarity index 100% rename from ext/src/ui/options/styles/mac.css rename to extension/src/ui/options/styles/mac.css diff --git a/ext/src/ui/photon-colors.css b/extension/src/ui/photon-colors.css similarity index 100% rename from ext/src/ui/photon-colors.css rename to extension/src/ui/photon-colors.css diff --git a/ext/src/ui/photon-widgets.css b/extension/src/ui/photon-widgets.css similarity index 100% rename from ext/src/ui/photon-widgets.css rename to extension/src/ui/photon-widgets.css diff --git a/ext/src/ui/popup/Popup.svelte b/extension/src/ui/popup/Popup.svelte similarity index 100% rename from ext/src/ui/popup/Popup.svelte rename to extension/src/ui/popup/Popup.svelte diff --git a/ext/src/ui/popup/Receiver.svelte b/extension/src/ui/popup/Receiver.svelte similarity index 100% rename from ext/src/ui/popup/Receiver.svelte rename to extension/src/ui/popup/Receiver.svelte diff --git a/ext/src/ui/popup/ReceiverMedia.svelte b/extension/src/ui/popup/ReceiverMedia.svelte similarity index 100% rename from ext/src/ui/popup/ReceiverMedia.svelte rename to extension/src/ui/popup/ReceiverMedia.svelte diff --git a/ext/src/ui/popup/icons/audio-muted.svg b/extension/src/ui/popup/icons/audio-muted.svg similarity index 100% rename from ext/src/ui/popup/icons/audio-muted.svg rename to extension/src/ui/popup/icons/audio-muted.svg diff --git a/ext/src/ui/popup/icons/audio-none.svg b/extension/src/ui/popup/icons/audio-none.svg similarity index 100% rename from ext/src/ui/popup/icons/audio-none.svg rename to extension/src/ui/popup/icons/audio-none.svg diff --git a/ext/src/ui/popup/icons/audio.svg b/extension/src/ui/popup/icons/audio.svg similarity index 100% rename from ext/src/ui/popup/icons/audio.svg rename to extension/src/ui/popup/icons/audio.svg diff --git a/ext/src/ui/popup/icons/backward.svg b/extension/src/ui/popup/icons/backward.svg similarity index 100% rename from ext/src/ui/popup/icons/backward.svg rename to extension/src/ui/popup/icons/backward.svg diff --git a/ext/src/ui/popup/icons/cc-off.svg b/extension/src/ui/popup/icons/cc-off.svg similarity index 100% rename from ext/src/ui/popup/icons/cc-off.svg rename to extension/src/ui/popup/icons/cc-off.svg diff --git a/ext/src/ui/popup/icons/cc-on.svg b/extension/src/ui/popup/icons/cc-on.svg similarity index 100% rename from ext/src/ui/popup/icons/cc-on.svg rename to extension/src/ui/popup/icons/cc-on.svg diff --git a/ext/src/ui/popup/icons/device-audio.svg b/extension/src/ui/popup/icons/device-audio.svg similarity index 100% rename from ext/src/ui/popup/icons/device-audio.svg rename to extension/src/ui/popup/icons/device-audio.svg diff --git a/ext/src/ui/popup/icons/device-video.svg b/extension/src/ui/popup/icons/device-video.svg similarity index 100% rename from ext/src/ui/popup/icons/device-video.svg rename to extension/src/ui/popup/icons/device-video.svg diff --git a/ext/src/ui/popup/icons/forward.svg b/extension/src/ui/popup/icons/forward.svg similarity index 100% rename from ext/src/ui/popup/icons/forward.svg rename to extension/src/ui/popup/icons/forward.svg diff --git a/ext/src/ui/popup/icons/next.svg b/extension/src/ui/popup/icons/next.svg similarity index 100% rename from ext/src/ui/popup/icons/next.svg rename to extension/src/ui/popup/icons/next.svg diff --git a/ext/src/ui/popup/icons/pause.svg b/extension/src/ui/popup/icons/pause.svg similarity index 100% rename from ext/src/ui/popup/icons/pause.svg rename to extension/src/ui/popup/icons/pause.svg diff --git a/ext/src/ui/popup/icons/play.svg b/extension/src/ui/popup/icons/play.svg similarity index 100% rename from ext/src/ui/popup/icons/play.svg rename to extension/src/ui/popup/icons/play.svg diff --git a/ext/src/ui/popup/icons/previous.svg b/extension/src/ui/popup/icons/previous.svg similarity index 100% rename from ext/src/ui/popup/icons/previous.svg rename to extension/src/ui/popup/icons/previous.svg diff --git a/ext/src/ui/popup/index.html b/extension/src/ui/popup/index.html similarity index 100% rename from ext/src/ui/popup/index.html rename to extension/src/ui/popup/index.html diff --git a/ext/src/ui/popup/index.ts b/extension/src/ui/popup/index.ts similarity index 100% rename from ext/src/ui/popup/index.ts rename to extension/src/ui/popup/index.ts diff --git a/ext/src/ui/popup/styles/index.css b/extension/src/ui/popup/styles/index.css similarity index 100% rename from ext/src/ui/popup/styles/index.css rename to extension/src/ui/popup/styles/index.css diff --git a/ext/src/ui/popup/styles/mac.css b/extension/src/ui/popup/styles/mac.css similarity index 100% rename from ext/src/ui/popup/styles/mac.css rename to extension/src/ui/popup/styles/mac.css diff --git a/ext/svelte.config.js b/extension/svelte.config.js similarity index 100% rename from ext/svelte.config.js rename to extension/svelte.config.js diff --git a/ext/tsconfig.json b/extension/tsconfig.json similarity index 100% rename from ext/tsconfig.json rename to extension/tsconfig.json diff --git a/package.json b/package.json index b4e94c8..9724118 100644 --- a/package.json +++ b/package.json @@ -1,25 +1,22 @@ { "scripts": { - "postinstall": "npm run postinstall:bridge && npm run postinstall:ext", + "postinstall": "npm run postinstall:bridge && npm run postinstall:extension", "postinstall:bridge": "cd bridge && npm install", - "postinstall:ext": "cd ext && npm install", - "build": "npm run build:bridge && npm run build:ext", + "postinstall:extension": "cd extension && npm install", + "build": "npm run build:bridge && npm run build:extension", "build:bridge": "cd bridge && npm run build", - "build:ext": "cd ext && npm run build", - "watch:ext": "cd ext && npm run watch", - "start:ext": "cd ext && npm run start", - "package": "npm run package:bridge && npm run package:ext", + "build:extension": "cd extension && npm run build", + "watch:extension": "cd extension && npm run watch", + "start:extension": "cd extension && npm run start", + "package": "npm run package:bridge && npm run package:extension", "package:bridge": "cd bridge && npm run package", - "package:ext": "cd ext && npm run package", + "package:extension": "cd extension && npm run package", "test": "node test/driver.js", "install-manifest": "cd bridge && npm run install-manifest", "remove-manifest": "cd bridge && npm run remove-manifest", - "lint": "npm run lint:bridge && npm run lint:ext", + "lint": "npm run lint:bridge && npm run lint:extension", "lint:bridge": "eslint bridge/src --ext .ts,.js", - "lint:ext": "eslint ext/src --ext .ts,.js,.svelte", - "build:app": "npm run build:bridge", - "package:app": "npm run package:bridge", - "lint:app": "npm run lint:bridge" + "lint:extension": "eslint extension/src --ext .ts,.js,.svelte" }, "devDependencies": { "@typescript-eslint/eslint-plugin": "^5.14.0", diff --git a/test/driver.js b/test/driver.js index 9cad487..f97ecbd 100644 --- a/test/driver.js +++ b/test/driver.js @@ -16,7 +16,7 @@ const chrome = require("selenium-webdriver/chrome"); const { By, until } = webdriver; const extensionArchivePath = glob.sync("*.xpi", { - cwd: path.join(__dirname, "../dist/ext"), + cwd: path.join(__dirname, "../dist/extension"), absolute: true })[0];