diff --git a/dev/data/manifest-variants.json b/dev/data/manifest-variants.json index 7e7c6566..3bb17029 100644 --- a/dev/data/manifest-variants.json +++ b/dev/data/manifest-variants.json @@ -25,10 +25,10 @@ "128": "images/icon128.png" }, "default_title": "Yomichan", - "default_popup": "bg/context.html" + "default_popup": "context.html" }, "background": { - "page": "bg/background.html", + "page": "background.html", "persistent": true }, "content_scripts": [ @@ -66,12 +66,12 @@ ], "minimum_chrome_version": "57.0.0.0", "options_ui": { - "page": "bg/settings2.html", + "page": "settings.html", "open_in_tab": true }, "sandbox": { "pages": [ - "bg/template-renderer.html" + "template-renderer.html" ], "content_security_policy": "sandbox allow-scripts; default-src 'self'; script-src 'self' 'unsafe-eval'" }, @@ -111,8 +111,8 @@ } }, "web_accessible_resources": [ - "fg/float.html", - "bg/template-renderer.html" + "float.html", + "template-renderer.html" ], "content_security_policy": "default-src 'self'; style-src 'self' 'unsafe-inline'; media-src *; connect-src *" }, @@ -174,7 +174,7 @@ {"action": "move", "path": ["web_accessible_resources_old"], "newPath": ["web_accessible_resources", 0, "resources"]} ], "excludeFiles": [ - "bg/background.html", + "background.html", "bg/js/native-simple-dom-parser.js" ] }, @@ -185,7 +185,7 @@ { "action": "remove", "path": ["web_accessible_resources"], - "item": "bg/template-renderer.html" + "item": "template-renderer.html" }, { "action": "delete", diff --git a/ext/bg/background.html b/ext/background.html similarity index 100% rename from ext/bg/background.html rename to ext/background.html diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js index a1f5e6d1..2fb290bb 100644 --- a/ext/bg/js/backend.js +++ b/ext/bg/js/backend.js @@ -559,7 +559,7 @@ class Backend { } async _onApiGetDisplayTemplatesHtml() { - return await this._fetchAsset('/mixed/display-templates.html'); + return await this._fetchAsset('/display-templates.html'); } _onApiGetZoom(params, sender) { @@ -678,7 +678,7 @@ class Backend { } async _onApiIsTabSearchPopup({tabId}) { - const baseUrl = chrome.runtime.getURL('/bg/search.html'); + const baseUrl = chrome.runtime.getURL('/search.html'); const tab = typeof tabId === 'number' ? await this._checkTabUrl(tabId, (url) => url.startsWith(baseUrl)) : null; return (tab !== null); } @@ -728,7 +728,7 @@ class Backend { async _onCommandOpenSearchPage(params) { const {mode='existingOrNewTab', query} = params || {}; - const baseUrl = chrome.runtime.getURL('/bg/search.html'); + const baseUrl = chrome.runtime.getURL('/search.html'); const queryParams = {}; if (query && query.length > 0) { queryParams.query = query; } const queryString = new URLSearchParams(queryParams).toString(); @@ -822,7 +822,7 @@ class Backend { async _getOrCreateSearchPopup2() { // Reuse same tab - const baseUrl = chrome.runtime.getURL('/bg/search.html'); + const baseUrl = chrome.runtime.getURL('/search.html'); if (this._searchPopupTabId !== null) { const tab = await this._checkTabUrl(this._searchPopupTabId, (url) => url.startsWith(baseUrl)); if (tab !== null) { @@ -1821,17 +1821,17 @@ class Backend { } async _openWelcomeGuidePage() { - await this._createTab(chrome.runtime.getURL('/bg/welcome.html')); + await this._createTab(chrome.runtime.getURL('/welcome.html')); } async _openInfoPage() { - await this._createTab(chrome.runtime.getURL('/bg/info.html')); + await this._createTab(chrome.runtime.getURL('/info.html')); } async _openSettingsPage(mode) { const {useSettingsV2} = this._options.global; const manifest = chrome.runtime.getManifest(); - const url = chrome.runtime.getURL(useSettingsV2 ? '/bg/settings2.html' : manifest.options_ui.page); + const url = chrome.runtime.getURL(useSettingsV2 ? '/settings.html' : manifest.options_ui.page); switch (mode) { case 'existingOrNewTab': if (useSettingsV2) { diff --git a/ext/bg/js/context-main.js b/ext/bg/js/context-main.js index a7ea1471..98716958 100644 --- a/ext/bg/js/context-main.js +++ b/ext/bg/js/context-main.js @@ -32,17 +32,17 @@ class DisplayController { this._showExtensionInfo(manifest); this._setupEnvironment(); - this._setupButtonEvents('.action-open-search', 'openSearchPage', chrome.runtime.getURL('/bg/search.html')); - this._setupButtonEvents('.action-open-info', 'openInfoPage', chrome.runtime.getURL('/bg/info.html')); + this._setupButtonEvents('.action-open-search', 'openSearchPage', chrome.runtime.getURL('/search.html')); + this._setupButtonEvents('.action-open-info', 'openInfoPage', chrome.runtime.getURL('/info.html')); const optionsFull = await api.optionsGetFull(); this._optionsFull = optionsFull; this._setupHotkeys(); - const optionsPageUrl = optionsFull.global.useSettingsV2 ? '/bg/settings2.html' : manifest.options_ui.page; + const optionsPageUrl = optionsFull.global.useSettingsV2 ? '/settings.html' : manifest.options_ui.page; this._setupButtonEvents('.action-open-settings', 'openSettingsPage', chrome.runtime.getURL(optionsPageUrl)); - this._setupButtonEvents('.action-open-permissions', null, chrome.runtime.getURL('/bg/permissions.html')); + this._setupButtonEvents('.action-open-permissions', null, chrome.runtime.getURL('/permissions.html')); const {profiles, profileCurrent} = optionsFull; const primaryProfile = (profileCurrent >= 0 && profileCurrent < profiles.length) ? profiles[profileCurrent] : null; diff --git a/ext/bg/js/settings/popup-preview-controller.js b/ext/bg/js/settings/popup-preview-controller.js index 06939bb4..f98b0679 100644 --- a/ext/bg/js/settings/popup-preview-controller.js +++ b/ext/bg/js/settings/popup-preview-controller.js @@ -80,7 +80,7 @@ class PopupPreviewController { customOuterCss.addEventListener('input', this._onCustomOuterCssChange.bind(this), false); this._settingsController.on('optionsContextChanged', this._onOptionsContextChange.bind(this)); - frame.src = '/bg/popup-preview.html'; + frame.src = '/popup-preview.html'; frame.id = 'settings-popup-preview-frame'; container.appendChild(frame); diff --git a/ext/bg/js/template-renderer-proxy.js b/ext/bg/js/template-renderer-proxy.js index 21d45a94..6a49832b 100644 --- a/ext/bg/js/template-renderer-proxy.js +++ b/ext/bg/js/template-renderer-proxy.js @@ -21,7 +21,7 @@ class TemplateRendererProxy { this._frameNeedsLoad = true; this._frameLoading = false; this._frameLoadPromise = null; - this._frameUrl = chrome.runtime.getURL('/bg/template-renderer.html'); + this._frameUrl = chrome.runtime.getURL('/template-renderer.html'); this._invocations = new Set(); } diff --git a/ext/bg/context.html b/ext/context.html similarity index 100% rename from ext/bg/context.html rename to ext/context.html diff --git a/ext/mixed/display-templates.html b/ext/display-templates.html similarity index 100% rename from ext/mixed/display-templates.html rename to ext/display-templates.html diff --git a/ext/fg/js/popup.js b/ext/fg/js/popup.js index 5e15a654..b920caf7 100644 --- a/ext/fg/js/popup.js +++ b/ext/fg/js/popup.js @@ -256,7 +256,7 @@ class Popup extends EventDispatcher { frame.removeAttribute('srcdoc'); this._observeFullscreen(true); this._onFullscreenChanged(); - const url = chrome.runtime.getURL('/fg/float.html'); + const url = chrome.runtime.getURL('/float.html'); if (useSecurePopupFrameUrl) { frame.contentDocument.location.href = url; } else { diff --git a/ext/fg/float.html b/ext/float.html similarity index 100% rename from ext/fg/float.html rename to ext/float.html diff --git a/ext/bg/info.html b/ext/info.html similarity index 96% rename from ext/bg/info.html rename to ext/info.html index 920f94a0..4dfe4c09 100644 --- a/ext/bg/info.html +++ b/ext/info.html @@ -47,7 +47,7 @@
  • Information and downloadable dictionaries: Homepage
  • Source code, bug reporting, and feedback: Github
  • Release notes: This version | All versions
  • -
  • More extension information: Permissions | Licenses
  • +
  • More extension information: Permissions | Licenses
  • diff --git a/ext/bg/legal.html b/ext/legal.html similarity index 100% rename from ext/bg/legal.html rename to ext/legal.html diff --git a/ext/manifest.json b/ext/manifest.json index 55535feb..233df081 100644 --- a/ext/manifest.json +++ b/ext/manifest.json @@ -24,10 +24,10 @@ "128": "images/icon128.png" }, "default_title": "Yomichan", - "default_popup": "bg/context.html" + "default_popup": "context.html" }, "background": { - "page": "bg/background.html", + "page": "background.html", "persistent": true }, "content_scripts": [ @@ -65,12 +65,12 @@ ], "minimum_chrome_version": "57.0.0.0", "options_ui": { - "page": "bg/settings2.html", + "page": "settings.html", "open_in_tab": true }, "sandbox": { "pages": [ - "bg/template-renderer.html" + "template-renderer.html" ], "content_security_policy": "sandbox allow-scripts; default-src 'self'; script-src 'self' 'unsafe-eval'" }, @@ -110,8 +110,8 @@ } }, "web_accessible_resources": [ - "fg/float.html", - "bg/template-renderer.html" + "float.html", + "template-renderer.html" ], "content_security_policy": "default-src 'self'; style-src 'self' 'unsafe-inline'; media-src *; connect-src *" } diff --git a/ext/bg/permissions.html b/ext/permissions.html similarity index 100% rename from ext/bg/permissions.html rename to ext/permissions.html diff --git a/ext/bg/pitch-accents-preview.html b/ext/pitch-accents-preview.html similarity index 100% rename from ext/bg/pitch-accents-preview.html rename to ext/pitch-accents-preview.html diff --git a/ext/bg/popup-preview.html b/ext/popup-preview.html similarity index 100% rename from ext/bg/popup-preview.html rename to ext/popup-preview.html diff --git a/ext/bg/search.html b/ext/search.html similarity index 100% rename from ext/bg/search.html rename to ext/search.html diff --git a/ext/bg/settings.html b/ext/settings-old.html similarity index 99% rename from ext/bg/settings.html rename to ext/settings-old.html index 3e3f1961..aa20daf4 100644 --- a/ext/bg/settings.html +++ b/ext/settings-old.html @@ -23,7 +23,7 @@
    This is the old version of the settings page, it will be removed in the next version. - Please use the new settings page + Please use the new settings page and feel free to share any feedback on Github.
    @@ -212,7 +212,7 @@
    - +
    @@ -1269,7 +1269,7 @@
    diff --git a/ext/bg/settings2.html b/ext/settings.html similarity index 99% rename from ext/bg/settings2.html rename to ext/settings.html index d0ba0b3c..6e35e818 100644 --- a/ext/bg/settings2.html +++ b/ext/settings.html @@ -49,7 +49,7 @@ }' > Advanced - About Yomichan + About Yomichan @@ -67,7 +67,7 @@
    Notice: This settings page is planned to replace - the old settings page.
    + the old settings page.
    Questions, comments, and other feedback is welcome and can be shared on Github.
    @@ -214,7 +214,7 @@
    -
    Show the welcome guide on browser startup
    +
    Show the welcome guide on browser startup
    @@ -726,7 +726,7 @@ Pitch accents for terms and expressions can be shown if a dictionary supporting pitch accents is installed. There are currently three different ways that pitch accents can be presented:

    - +

    Less…

    @@ -1769,7 +1769,7 @@
    - +
    diff --git a/ext/bg/template-renderer.html b/ext/template-renderer.html similarity index 100% rename from ext/bg/template-renderer.html rename to ext/template-renderer.html diff --git a/ext/bg/welcome.html b/ext/welcome.html similarity index 97% rename from ext/bg/welcome.html rename to ext/welcome.html index 53c386fd..d45bc914 100644 --- a/ext/bg/welcome.html +++ b/ext/welcome.html @@ -32,15 +32,15 @@
    - The cog button will open the Settings page. + The cog button will open the Settings page.
    - The magnifying glass button will open the Search page, + The magnifying glass button will open the Search page, enabling text and terms to be looked up using the installed dictionaries. This can even be used in offline mode!
    - The question mark button will open the Information page, + The question mark button will open the Information page, which has some helpful information and links about Yomichan.
    @@ -51,7 +51,7 @@ Several downloadable dictionaries can be found on the Yomichan homepage, allowing you to choose the dictionaries most relevant for you. Dictionaries can be configured using the button below, - or later from the the Settings page. + or later from the the Settings page.
    @@ -82,7 +82,7 @@
    - This startup notification can be turned off using the options below, or later from the Settings page. + This startup notification can be turned off using the options below, or later from the Settings page.
    @@ -165,7 +165,7 @@
    -
    +
    More customization options are available on the Settings page
    @@ -234,7 +234,7 @@
    - More dictionary settings are available on the Settings page + More dictionary settings are available on the Settings page
    diff --git a/test/test-sw.js b/test/test-sw.js index 8c7b2ab3..5da80dd2 100644 --- a/test/test-sw.js +++ b/test/test-sw.js @@ -50,7 +50,7 @@ function main() { const extDirName = 'ext'; const extDir = path.join(rootDir, extDirName); - const scripts = getAllHtmlScriptPaths(path.join(extDir, 'bg', 'background.html')); + const scripts = getAllHtmlScriptPaths(path.join(extDir, 'background.html')); convertBackgroundScriptsToServiceWorkerScripts(scripts); const importedScripts = [];