Test html script ordering (#1396)

* Simplify getAllFiles

* Add test to validate script order

* Update script include order

* Update content script order

* Update sw.js and corresponding lint

* Update manifest
This commit is contained in:
toasted-nutbread 2021-02-14 20:25:41 -05:00 committed by GitHub
parent d97c84f8ac
commit d6332d2bc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 343 additions and 252 deletions

View File

@ -166,30 +166,30 @@
"files": [ "files": [
"ext/js/core.js", "ext/js/core.js",
"ext/js/yomichan.js", "ext/js/yomichan.js",
"ext/js/background/backend.js",
"ext/js/background/environment.js", "ext/js/background/environment.js",
"ext/js/language/japanese-util.js",
"ext/js/general/cache-map.js",
"ext/js/language/dictionary-data-util.js",
"ext/js/general/object-property-accessor.js",
"ext/js/comm/anki.js",
"ext/js/media/audio-downloader.js",
"ext/js/comm/clipboard-monitor.js",
"ext/js/comm/clipboard-reader.js",
"ext/js/data/database.js",
"ext/js/language/deinflector.js",
"ext/js/language/dictionary-database.js",
"ext/js/data/json-schema.js",
"ext/js/comm/mecab.js",
"ext/js/media/media-util.js",
"ext/js/data/options-util.js",
"ext/js/data/permissions-util.js",
"ext/js/background/profile-conditions-util.js", "ext/js/background/profile-conditions-util.js",
"ext/js/background/request-builder.js", "ext/js/background/request-builder.js",
"ext/js/comm/anki.js",
"ext/js/comm/clipboard-monitor.js",
"ext/js/comm/clipboard-reader.js",
"ext/js/comm/mecab.js",
"ext/js/data/database.js",
"ext/js/data/json-schema.js",
"ext/js/data/options-util.js",
"ext/js/data/permissions-util.js",
"ext/js/dom/simple-dom-parser.js", "ext/js/dom/simple-dom-parser.js",
"ext/js/templates/template-patcher.js", "ext/js/general/cache-map.js",
"ext/js/general/object-property-accessor.js",
"ext/js/general/text-source-map.js", "ext/js/general/text-source-map.js",
"ext/js/language/deinflector.js",
"ext/js/language/dictionary-data-util.js",
"ext/js/language/dictionary-database.js",
"ext/js/language/japanese-util.js",
"ext/js/language/translator.js", "ext/js/language/translator.js",
"ext/js/background/backend.js", "ext/js/media/audio-downloader.js",
"ext/js/media/media-util.js",
"ext/js/templates/template-patcher.js",
"ext/js/background/background-main.js" "ext/js/background/background-main.js"
], ],
"env": { "env": {

View File

@ -62,7 +62,7 @@ async function createZip(directory, excludeFiles, outputFileName, sevenZipExes,
async function createJSZip(directory, excludeFiles, outputFileName, onUpdate, dryRun) { async function createJSZip(directory, excludeFiles, outputFileName, onUpdate, dryRun) {
const JSZip = util.JSZip; const JSZip = util.JSZip;
const files = getAllFiles(directory, directory); const files = getAllFiles(directory);
removeItemsFromArray(files, excludeFiles); removeItemsFromArray(files, excludeFiles);
const zip = new JSZip(); const zip = new JSZip();
for (const fileName of files) { for (const fileName of files) {

View File

@ -41,23 +41,23 @@
"js": [ "js": [
"js/core.js", "js/core.js",
"js/yomichan.js", "js/yomichan.js",
"js/comm/cross-frame-api.js", "js/app/frontend.js",
"js/comm/api.js",
"js/script/dynamic-loader.js",
"js/comm/frame-client.js",
"js/language/text-scanner.js",
"js/dom/document-util.js",
"js/input/hotkey-handler.js",
"js/dom/dom-text-scanner.js",
"js/app/popup.js", "js/app/popup.js",
"js/dom/text-source-range.js",
"js/dom/text-source-element.js",
"js/app/popup-factory.js", "js/app/popup-factory.js",
"js/comm/frame-ancestry-handler.js",
"js/comm/frame-offset-forwarder.js",
"js/app/popup-proxy.js", "js/app/popup-proxy.js",
"js/app/popup-window.js", "js/app/popup-window.js",
"js/app/frontend.js", "js/comm/api.js",
"js/comm/cross-frame-api.js",
"js/comm/frame-ancestry-handler.js",
"js/comm/frame-client.js",
"js/comm/frame-offset-forwarder.js",
"js/dom/dom-text-scanner.js",
"js/dom/document-util.js",
"js/dom/text-source-element.js",
"js/dom/text-source-range.js",
"js/input/hotkey-handler.js",
"js/language/text-scanner.js",
"js/script/dynamic-loader.js",
"js/app/content-script-main.js" "js/app/content-script-main.js"
], ],
"match_about_blank": true, "match_about_blank": true,

View File

@ -117,10 +117,10 @@ function main() {
const fix = (process.argv.length >= 2 && process.argv[2] === '--fix'); const fix = (process.argv.length >= 2 && process.argv[2] === '--fix');
const directory = path.resolve(__dirname, '..', '..', 'ext'); const directory = path.resolve(__dirname, '..', '..', 'ext');
const pattern = /\.js$/; const pattern = /\.js$/;
const ignorePattern = /[\\/]ext[\\/]lib[\\/]/; const ignorePattern = /^lib[\\/]/;
const fileNames = getAllFiles(directory, null, (f) => pattern.test(f) && !ignorePattern.test(f)); const fileNames = getAllFiles(directory, (f) => pattern.test(f) && !ignorePattern.test(f));
for (const fileName of fileNames) { for (const fileName of fileNames) {
if (!validateGlobals(fileName, fix)) { if (!validateGlobals(path.join(directory, fileName), fix)) {
process.exit(-1); process.exit(-1);
return; return;
} }

View File

@ -41,18 +41,110 @@ function validatePath(src, fileName, extDir) {
assert.ok(stats.isFile(), `<script> src file invalid in ${fileName} (src=${JSON.stringify(src)})`); assert.ok(stats.isFile(), `<script> src file invalid in ${fileName} (src=${JSON.stringify(src)})`);
} }
function getSubstringCount(string, pattern) {
let count = 0;
while (true) {
const match = pattern.exec(string);
if (match === null) { break; }
++count;
}
return count;
}
function getSortedScriptPaths(scriptPaths) {
// Sort file names without the extension
const extensionPattern = /\.[^.]*$/;
scriptPaths = scriptPaths.map((value) => {
const match = extensionPattern.exec(value);
let ext = '';
if (match !== null) {
ext = match[0];
value = value.substring(0, value.length - ext.length);
}
return {value, ext};
});
const stringComparer = new Intl.Collator('en-US'); // Invariant locale
scriptPaths.sort((a, b) => stringComparer.compare(a.value, b.value));
scriptPaths = scriptPaths.map(({value, ext}) => `${value}${ext}`);
return scriptPaths;
}
function validateScriptOrder(fileName, window) {
const {document, Node: {ELEMENT_NODE, TEXT_NODE}, NodeFilter} = window;
const scriptElements = document.querySelectorAll('script');
if (scriptElements.length === 0) { return; }
// Assert all scripts are siblings
const scriptContainerElement = scriptElements[0].parentNode;
for (const element of scriptElements) {
if (element.parentNode !== scriptContainerElement) {
assert.fail('All script nodes are not contained within the same element');
}
}
// Get script groupings and order
const scriptGroups = [];
const newlinePattern = /\n/g;
let separatingText = '';
const walker = document.createTreeWalker(scriptContainerElement, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT);
walker.firstChild();
for (let node = walker.currentNode; node !== null; node = walker.nextSibling()) {
switch (node.nodeType) {
case ELEMENT_NODE:
if (node.tagName.toLowerCase() === 'script') {
let scriptGroup;
if (scriptGroups.length === 0 || getSubstringCount(separatingText, newlinePattern) >= 2) {
scriptGroup = [];
scriptGroups.push(scriptGroup);
} else {
scriptGroup = scriptGroups[scriptGroups.length - 1];
}
scriptGroup.push(node.src);
separatingText = '';
}
break;
case TEXT_NODE:
separatingText += node.nodeValue;
break;
}
}
// Ensure core.js is first (if it is present)
const ignorePattern = /^\/lib\//;
const index = scriptGroups.flat()
.filter((value) => !ignorePattern.test(value))
.findIndex((value) => (value === '/js/core.js'));
assert.ok(index <= 0, 'core.js is not the first included script');
// Check script order
for (let i = 0, ii = scriptGroups.length; i < ii; ++i) {
const scriptGroup = scriptGroups[i];
try {
assert.deepStrictEqual(scriptGroup, getSortedScriptPaths(scriptGroup));
} catch (e) {
console.error(`Script order for group ${i + 1} in file ${fileName} is not correct:`);
throw e;
}
}
}
function validateHtmlScripts(fileName, extDir) { function validateHtmlScripts(fileName, extDir) {
const domSource = fs.readFileSync(fileName, {encoding: 'utf8'}); const fullFileName = path.join(extDir, fileName);
const domSource = fs.readFileSync(fullFileName, {encoding: 'utf8'});
const dom = new JSDOM(domSource); const dom = new JSDOM(domSource);
const {window} = dom; const {window} = dom;
const {document} = window; const {document} = window;
try { try {
for (const {src} of document.querySelectorAll('script')) { for (const {src} of document.querySelectorAll('script')) {
validatePath(src, fileName, extDir); validatePath(src, fullFileName, extDir);
} }
for (const {href} of document.querySelectorAll('link')) { for (const {href} of document.querySelectorAll('link')) {
validatePath(href, fileName, extDir); validatePath(href, fullFileName, extDir);
} }
validateScriptOrder(fileName, window);
} finally { } finally {
window.close(); window.close();
} }
@ -63,8 +155,8 @@ function main() {
try { try {
const extDir = path.resolve(__dirname, '..', '..', 'ext'); const extDir = path.resolve(__dirname, '..', '..', 'ext');
const pattern = /\.html$/; const pattern = /\.html$/;
const ignorePattern = /[\\/]ext[\\/]lib[\\/]/; const ignorePattern = /^lib[\\/]/;
const fileNames = getAllFiles(extDir, null, (f) => pattern.test(f) && !ignorePattern.test(f)); const fileNames = getAllFiles(extDir, (f) => pattern.test(f) && !ignorePattern.test(f));
for (const fileName of fileNames) { for (const fileName of fileNames) {
validateHtmlScripts(fileName, extDir); validateHtmlScripts(fileName, extDir);
} }

View File

@ -76,7 +76,7 @@ function getArgs(args, argMap) {
return argMap; return argMap;
} }
function getAllFiles(baseDirectory, relativeTo=null, predicate=null) { function getAllFiles(baseDirectory, predicate=null) {
const results = []; const results = [];
const directories = [baseDirectory]; const directories = [baseDirectory];
while (directories.length > 0) { while (directories.length > 0) {
@ -84,10 +84,10 @@ function getAllFiles(baseDirectory, relativeTo=null, predicate=null) {
const fileNames = fs.readdirSync(directory); const fileNames = fs.readdirSync(directory);
for (const fileName of fileNames) { for (const fileName of fileNames) {
const fullFileName = path.join(directory, fileName); const fullFileName = path.join(directory, fileName);
const relativeFileName = (relativeTo !== null ? path.relative(relativeTo, fullFileName) : fullFileName); const relativeFileName = path.relative(baseDirectory, fullFileName);
const stats = fs.lstatSync(fullFileName); const stats = fs.lstatSync(fullFileName);
if (stats.isFile()) { if (stats.isFile()) {
if (typeof predicate !== 'function' || predicate(fullFileName, directory, baseDirectory)) { if (typeof predicate !== 'function' || predicate(relativeFileName)) {
results.push(relativeFileName); results.push(relativeFileName);
} }
} else if (stats.isDirectory()) { } else if (stats.isDirectory()) {

View File

@ -82,14 +82,14 @@
</div> </div>
<script src="/js/core.js"></script> <script src="/js/core.js"></script>
<script src="/js/yomichan.js"></script>
<script src="/js/comm/cross-frame-api.js"></script>
<script src="/js/comm/api.js"></script>
<script src="/js/input/hotkey-help-controller.js"></script> <script src="/js/comm/api.js"></script>
<script src="/js/input/hotkey-util.js"></script> <script src="/js/comm/cross-frame-api.js"></script>
<script src="/js/yomichan.js"></script>
<script src="/js/data/permissions-util.js"></script> <script src="/js/data/permissions-util.js"></script>
<script src="/js/input/hotkey-help-controller.js"></script>
<script src="/js/input/hotkey-util.js"></script>
<script src="/js/pages/action-popup-main.js"></script> <script src="/js/pages/action-popup-main.js"></script>

View File

@ -18,34 +18,33 @@
<script src="/lib/wanakana.min.js"></script> <script src="/lib/wanakana.min.js"></script>
<script src="/js/core.js"></script> <script src="/js/core.js"></script>
<script src="/js/yomichan.js"></script> <script src="/js/yomichan.js"></script>
<script src="/js/background/environment.js"></script>
<script src="/js/language/japanese-util.js"></script>
<script src="/js/general/cache-map.js"></script>
<script src="/js/language/dictionary-data-util.js"></script>
<script src="/js/general/object-property-accessor.js"></script>
<script src="/js/comm/anki.js"></script>
<script src="/js/media/audio-downloader.js"></script>
<script src="/js/comm/clipboard-monitor.js"></script>
<script src="/js/comm/clipboard-reader.js"></script>
<script src="/js/data/database.js"></script>
<script src="/js/language/deinflector.js"></script>
<script src="/js/language/dictionary-database.js"></script>
<script src="/js/data/json-schema.js"></script>
<script src="/js/comm/mecab.js"></script>
<script src="/js/media/media-util.js"></script>
<script src="/js/data/options-util.js"></script>
<script src="/js/data/permissions-util.js"></script>
<script src="/js/background/profile-conditions-util.js"></script>
<script src="/js/background/request-builder.js"></script>
<script src="/js/dom/native-simple-dom-parser.js"></script>
<script src="/js/templates/template-patcher.js"></script>
<script src="/js/general/text-source-map.js"></script>
<script src="/js/language/translator.js"></script>
<script src="/js/background/backend.js"></script> <script src="/js/background/backend.js"></script>
<script src="/js/background/environment.js"></script>
<script src="/js/background/profile-conditions-util.js"></script>
<script src="/js/background/request-builder.js"></script>
<script src="/js/comm/anki.js"></script>
<script src="/js/comm/clipboard-monitor.js"></script>
<script src="/js/comm/clipboard-reader.js"></script>
<script src="/js/comm/mecab.js"></script>
<script src="/js/data/database.js"></script>
<script src="/js/data/json-schema.js"></script>
<script src="/js/data/options-util.js"></script>
<script src="/js/data/permissions-util.js"></script>
<script src="/js/dom/native-simple-dom-parser.js"></script>
<script src="/js/general/cache-map.js"></script>
<script src="/js/general/object-property-accessor.js"></script>
<script src="/js/general/text-source-map.js"></script>
<script src="/js/language/deinflector.js"></script>
<script src="/js/language/dictionary-data-util.js"></script>
<script src="/js/language/dictionary-database.js"></script>
<script src="/js/language/japanese-util.js"></script>
<script src="/js/language/translator.js"></script>
<script src="/js/media/audio-downloader.js"></script>
<script src="/js/media/media-util.js"></script>
<script src="/js/templates/template-patcher.js"></script>
<script src="/js/background/background-main.js"></script> <script src="/js/background/background-main.js"></script>

View File

@ -59,15 +59,16 @@
<!-- Scripts --> <!-- Scripts -->
<script src="/js/core.js"></script> <script src="/js/core.js"></script>
<script src="/js/yomichan.js"></script>
<script src="/js/comm/cross-frame-api.js"></script>
<script src="/js/comm/api.js"></script>
<script src="/js/yomichan.js"></script>
<script src="/js/comm/api.js"></script>
<script src="/js/comm/cross-frame-api.js"></script>
<script src="/js/data/permissions-util.js"></script>
<script src="/js/dom/document-focus-controller.js"></script> <script src="/js/dom/document-focus-controller.js"></script>
<script src="/js/dom/html-template-collection.js"></script> <script src="/js/dom/html-template-collection.js"></script>
<script src="/js/data/permissions-util.js"></script>
<script src="/js/settings/settings-controller.js"></script>
<script src="/js/settings/backup-controller.js"></script> <script src="/js/settings/backup-controller.js"></script>
<script src="/js/settings/settings-controller.js"></script>
<script src="/js/pages/info-main.js"></script> <script src="/js/pages/info-main.js"></script>

View File

@ -40,23 +40,23 @@
"js": [ "js": [
"js/core.js", "js/core.js",
"js/yomichan.js", "js/yomichan.js",
"js/comm/cross-frame-api.js", "js/app/frontend.js",
"js/comm/api.js",
"js/script/dynamic-loader.js",
"js/comm/frame-client.js",
"js/language/text-scanner.js",
"js/dom/document-util.js",
"js/input/hotkey-handler.js",
"js/dom/dom-text-scanner.js",
"js/app/popup.js", "js/app/popup.js",
"js/dom/text-source-range.js",
"js/dom/text-source-element.js",
"js/app/popup-factory.js", "js/app/popup-factory.js",
"js/comm/frame-ancestry-handler.js",
"js/comm/frame-offset-forwarder.js",
"js/app/popup-proxy.js", "js/app/popup-proxy.js",
"js/app/popup-window.js", "js/app/popup-window.js",
"js/app/frontend.js", "js/comm/api.js",
"js/comm/cross-frame-api.js",
"js/comm/frame-ancestry-handler.js",
"js/comm/frame-client.js",
"js/comm/frame-offset-forwarder.js",
"js/dom/dom-text-scanner.js",
"js/dom/document-util.js",
"js/dom/text-source-element.js",
"js/dom/text-source-range.js",
"js/input/hotkey-handler.js",
"js/language/text-scanner.js",
"js/script/dynamic-loader.js",
"js/app/content-script-main.js" "js/app/content-script-main.js"
], ],
"match_about_blank": true, "match_about_blank": true,

View File

@ -162,13 +162,14 @@
<!-- Scripts --> <!-- Scripts -->
<script src="/js/core.js"></script> <script src="/js/core.js"></script>
<script src="/js/yomichan.js"></script>
<script src="/js/comm/cross-frame-api.js"></script>
<script src="/js/comm/api.js"></script>
<script src="/js/yomichan.js"></script>
<script src="/js/comm/api.js"></script>
<script src="/js/comm/cross-frame-api.js"></script>
<script src="/js/data/permissions-util.js"></script>
<script src="/js/dom/document-focus-controller.js"></script> <script src="/js/dom/document-focus-controller.js"></script>
<script src="/js/dom/html-template-collection.js"></script> <script src="/js/dom/html-template-collection.js"></script>
<script src="/js/data/permissions-util.js"></script>
<script src="/js/settings/permissions-toggle-controller.js"></script> <script src="/js/settings/permissions-toggle-controller.js"></script>
<script src="/js/settings/settings-controller.js"></script> <script src="/js/settings/settings-controller.js"></script>

View File

@ -50,10 +50,11 @@
</div></div> </div></div>
<script src="/js/core.js"></script> <script src="/js/core.js"></script>
<script src="/js/yomichan.js"></script>
<script src="/js/comm/cross-frame-api.js"></script>
<script src="/js/comm/api.js"></script>
<script src="/js/yomichan.js"></script>
<script src="/js/comm/api.js"></script>
<script src="/js/comm/cross-frame-api.js"></script>
<script src="/js/display/display-generator.js"></script> <script src="/js/display/display-generator.js"></script>
<script src="/js/dom/html-template-collection.js"></script> <script src="/js/dom/html-template-collection.js"></script>

View File

@ -37,23 +37,24 @@
<script src="/lib/wanakana.min.js"></script> <script src="/lib/wanakana.min.js"></script>
<script src="/js/core.js"></script> <script src="/js/core.js"></script>
<script src="/js/yomichan.js"></script>
<script src="/js/comm/cross-frame-api.js"></script>
<script src="/js/comm/api.js"></script>
<script src="/js/script/dynamic-loader.js"></script>
<script src="/js/comm/frame-client.js"></script>
<script src="/js/language/text-scanner.js"></script>
<script src="/js/dom/document-util.js"></script> <script src="/js/yomichan.js"></script>
<script src="/js/input/hotkey-handler.js"></script>
<script src="/js/dom/dom-text-scanner.js"></script>
<script src="/js/app/popup.js"></script>
<script src="/js/dom/text-source-range.js"></script>
<script src="/js/dom/text-source-element.js"></script>
<script src="/js/app/popup-factory.js"></script>
<script src="/js/app/frontend.js"></script> <script src="/js/app/frontend.js"></script>
<script src="/js/app/popup.js"></script>
<script src="/js/app/popup-factory.js"></script>
<script src="/js/comm/api.js"></script>
<script src="/js/comm/cross-frame-api.js"></script>
<script src="/js/comm/frame-ancestry-handler.js"></script> <script src="/js/comm/frame-ancestry-handler.js"></script>
<script src="/js/comm/frame-client.js"></script>
<script src="/js/comm/frame-offset-forwarder.js"></script> <script src="/js/comm/frame-offset-forwarder.js"></script>
<script src="/js/dom/document-util.js"></script>
<script src="/js/dom/dom-text-scanner.js"></script>
<script src="/js/dom/text-source-element.js"></script>
<script src="/js/dom/text-source-range.js"></script>
<script src="/js/input/hotkey-handler.js"></script>
<script src="/js/language/text-scanner.js"></script>
<script src="/js/script/dynamic-loader.js"></script>
<script src="/js/settings/popup-preview-frame.js"></script> <script src="/js/settings/popup-preview-frame.js"></script>
<script src="/js/settings/popup-preview-frame-main.js"></script> <script src="/js/settings/popup-preview-frame-main.js"></script>

View File

@ -90,42 +90,41 @@
<!-- Scripts --> <!-- Scripts -->
<script src="/js/core.js"></script> <script src="/js/core.js"></script>
<script src="/js/yomichan.js"></script>
<script src="/js/comm/cross-frame-api.js"></script>
<script src="/js/comm/api.js"></script>
<script src="/js/language/japanese-util.js"></script>
<script src="/js/dom/document-util.js"></script> <script src="/js/yomichan.js"></script>
<script src="/js/dom/dom-text-scanner.js"></script>
<script src="/js/dom/text-source-range.js"></script> <script src="/js/comm/api.js"></script>
<script src="/js/dom/text-source-element.js"></script> <script src="/js/comm/cross-frame-api.js"></script>
<script src="/js/media/audio-system.js"></script> <script src="/js/comm/frame-endpoint.js"></script>
<script src="/js/language/dictionary-data-util.js"></script> <script src="/js/data/anki-note-builder.js"></script>
<script src="/js/display/display.js"></script> <script src="/js/display/display.js"></script>
<script src="/js/display/display-audio.js"></script> <script src="/js/display/display-audio.js"></script>
<script src="/js/display/display-generator.js"></script> <script src="/js/display/display-generator.js"></script>
<script src="/js/display/display-history.js"></script> <script src="/js/display/display-history.js"></script>
<script src="/js/display/display-notification.js"></script> <script src="/js/display/display-notification.js"></script>
<script src="/js/display/display-profile-selection.js"></script> <script src="/js/display/display-profile-selection.js"></script>
<script src="/js/display/query-parser.js"></script>
<script src="/js/dom/document-focus-controller.js"></script> <script src="/js/dom/document-focus-controller.js"></script>
<script src="/js/script/dynamic-loader.js"></script> <script src="/js/dom/document-util.js"></script>
<script src="/js/comm/frame-endpoint.js"></script> <script src="/js/dom/dom-text-scanner.js"></script>
<script src="/js/input/hotkey-handler.js"></script> <script src="/js/dom/html-template-collection.js"></script>
<script src="/js/input/hotkey-help-controller.js"></script>
<script src="/js/input/hotkey-util.js"></script>
<script src="/js/media/media-loader.js"></script>
<script src="/js/dom/panel-element.js"></script> <script src="/js/dom/panel-element.js"></script>
<script src="/js/dom/popup-menu.js"></script> <script src="/js/dom/popup-menu.js"></script>
<script src="/js/dom/scroll-element.js"></script> <script src="/js/dom/scroll-element.js"></script>
<script src="/js/dom/text-source-element.js"></script>
<script src="/js/dom/text-source-range.js"></script>
<script src="/js/input/hotkey-handler.js"></script>
<script src="/js/input/hotkey-help-controller.js"></script>
<script src="/js/input/hotkey-util.js"></script>
<script src="/js/language/dictionary-data-util.js"></script>
<script src="/js/language/japanese-util.js"></script>
<script src="/js/language/text-scanner.js"></script> <script src="/js/language/text-scanner.js"></script>
<script src="/js/dom/html-template-collection.js"></script> <script src="/js/media/audio-system.js"></script>
<script src="/js/media/media-loader.js"></script>
<script src="/js/media/text-to-speech-audio.js"></script> <script src="/js/media/text-to-speech-audio.js"></script>
<script src="/js/script/dynamic-loader.js"></script>
<script src="/js/data/anki-note-builder.js"></script>
<script src="/js/templates/template-renderer-proxy.js"></script> <script src="/js/templates/template-renderer-proxy.js"></script>
<script src="/js/display/query-parser.js"></script>
<script src="/js/display/popup-main.js"></script> <script src="/js/display/popup-main.js"></script>
</body> </body>

View File

@ -76,41 +76,40 @@
<script src="/lib/wanakana.min.js"></script> <script src="/lib/wanakana.min.js"></script>
<script src="/js/core.js"></script> <script src="/js/core.js"></script>
<script src="/js/yomichan.js"></script>
<script src="/js/comm/cross-frame-api.js"></script>
<script src="/js/comm/api.js"></script>
<script src="/js/language/japanese-util.js"></script>
<script src="/js/dom/document-focus-controller.js"></script> <script src="/js/yomichan.js"></script>
<script src="/js/dom/document-util.js"></script>
<script src="/js/dom/dom-text-scanner.js"></script> <script src="/js/comm/api.js"></script>
<script src="/js/dom/text-source-range.js"></script> <script src="/js/comm/clipboard-monitor.js"></script>
<script src="/js/dom/text-source-element.js"></script> <script src="/js/comm/cross-frame-api.js"></script>
<script src="/js/media/audio-system.js"></script> <script src="/js/data/anki-note-builder.js"></script>
<script src="/js/language/dictionary-data-util.js"></script>
<script src="/js/display/display.js"></script> <script src="/js/display/display.js"></script>
<script src="/js/display/display-audio.js"></script> <script src="/js/display/display-audio.js"></script>
<script src="/js/display/display-generator.js"></script> <script src="/js/display/display-generator.js"></script>
<script src="/js/display/display-history.js"></script> <script src="/js/display/display-history.js"></script>
<script src="/js/display/display-notification.js"></script> <script src="/js/display/display-notification.js"></script>
<script src="/js/script/dynamic-loader.js"></script> <script src="/js/display/query-parser.js"></script>
<script src="/js/display/search-display-controller.js"></script>
<script src="/js/dom/document-focus-controller.js"></script>
<script src="/js/dom/document-util.js"></script>
<script src="/js/dom/dom-text-scanner.js"></script>
<script src="/js/dom/html-template-collection.js"></script>
<script src="/js/dom/popup-menu.js"></script>
<script src="/js/dom/scroll-element.js"></script>
<script src="/js/dom/text-source-element.js"></script>
<script src="/js/dom/text-source-range.js"></script>
<script src="/js/input/hotkey-handler.js"></script> <script src="/js/input/hotkey-handler.js"></script>
<script src="/js/input/hotkey-help-controller.js"></script> <script src="/js/input/hotkey-help-controller.js"></script>
<script src="/js/input/hotkey-util.js"></script> <script src="/js/input/hotkey-util.js"></script>
<script src="/js/media/media-loader.js"></script> <script src="/js/language/dictionary-data-util.js"></script>
<script src="/js/dom/popup-menu.js"></script> <script src="/js/language/japanese-util.js"></script>
<script src="/js/dom/scroll-element.js"></script>
<script src="/js/language/text-scanner.js"></script> <script src="/js/language/text-scanner.js"></script>
<script src="/js/dom/html-template-collection.js"></script> <script src="/js/media/audio-system.js"></script>
<script src="/js/media/media-loader.js"></script>
<script src="/js/media/text-to-speech-audio.js"></script> <script src="/js/media/text-to-speech-audio.js"></script>
<script src="/js/script/dynamic-loader.js"></script>
<script src="/js/data/anki-note-builder.js"></script>
<script src="/js/templates/template-renderer-proxy.js"></script> <script src="/js/templates/template-renderer-proxy.js"></script>
<script src="/js/display/query-parser.js"></script>
<script src="/js/comm/clipboard-monitor.js"></script>
<script src="/js/display/search-display-controller.js"></script>
<script src="/js/display/search-main.js"></script> <script src="/js/display/search-main.js"></script>
</body> </body>

View File

@ -1274,60 +1274,59 @@
</div> </div>
<script src="/lib/jquery.min.js"></script> <script src="/lib/jquery.min.js"></script>
<script src="/lib/bootstrap/js/bootstrap.min.js"></script> <script src="/lib/bootstrap/js/bootstrap.min.js"></script>
<script src="/lib/jszip.min.js"></script> <script src="/lib/jszip.min.js"></script>
<script src="/lib/wanakana.min.js"></script> <script src="/lib/wanakana.min.js"></script>
<script src="/js/core.js"></script> <script src="/js/core.js"></script>
<script src="/js/yomichan.js"></script>
<script src="/js/comm/cross-frame-api.js"></script>
<script src="/js/background/environment.js"></script>
<script src="/js/comm/api.js"></script>
<script src="/js/language/japanese-util.js"></script>
<script src="/js/media/audio-system.js"></script> <script src="/js/yomichan.js"></script>
<script src="/js/general/cache-map.js"></script>
<script src="/js/language/dictionary-data-util.js"></script> <script src="/js/background/environment.js"></script>
<script src="/js/comm/anki.js"></script>
<script src="/js/comm/api.js"></script>
<script src="/js/comm/cross-frame-api.js"></script>
<script src="/js/data/anki-note-builder.js"></script>
<script src="/js/data/database.js"></script>
<script src="/js/data/json-schema.js"></script>
<script src="/js/data/options-util.js"></script>
<script src="/js/data/permissions-util.js"></script>
<script src="/js/dom/document-util.js"></script> <script src="/js/dom/document-util.js"></script>
<script src="/js/dom/dom-data-binder.js"></script> <script src="/js/dom/dom-data-binder.js"></script>
<script src="/js/dom/html-template-collection.js"></script> <script src="/js/dom/html-template-collection.js"></script>
<script src="/js/input/hotkey-util.js"></script>
<script src="/js/general/object-property-accessor.js"></script>
<script src="/js/dom/selector-observer.js"></script> <script src="/js/dom/selector-observer.js"></script>
<script src="/js/general/cache-map.js"></script>
<script src="/js/general/object-property-accessor.js"></script>
<script src="/js/general/task-accumulator.js"></script> <script src="/js/general/task-accumulator.js"></script>
<script src="/js/media/text-to-speech-audio.js"></script> <script src="/js/input/hotkey-util.js"></script>
<script src="/js/language/dictionary-data-util.js"></script>
<script src="/js/comm/anki.js"></script>
<script src="/js/data/anki-note-builder.js"></script>
<script src="/js/data/options-util.js"></script>
<script src="/js/data/database.js"></script>
<script src="/js/language/dictionary-database.js"></script> <script src="/js/language/dictionary-database.js"></script>
<script src="/js/language/dictionary-importer.js"></script> <script src="/js/language/dictionary-importer.js"></script>
<script src="/js/data/json-schema.js"></script> <script src="/js/language/japanese-util.js"></script>
<script src="/js/media/audio-system.js"></script>
<script src="/js/media/media-util.js"></script> <script src="/js/media/media-util.js"></script>
<script src="/js/data/permissions-util.js"></script> <script src="/js/media/text-to-speech-audio.js"></script>
<script src="/js/templates/template-patcher.js"></script>
<script src="/js/templates/template-renderer-proxy.js"></script>
<script src="/js/settings/keyboard-mouse-input-field.js"></script>
<script src="/js/settings/modal-jquery.js"></script>
<script src="/js/settings/profile-conditions-ui.js"></script>
<script src="/js/settings/anki-controller.js"></script> <script src="/js/settings/anki-controller.js"></script>
<script src="/js/settings/anki-templates-controller.js"></script> <script src="/js/settings/anki-templates-controller.js"></script>
<script src="/js/settings/audio-controller.js"></script> <script src="/js/settings/audio-controller.js"></script>
<script src="/js/settings/backup-controller.js"></script> <script src="/js/settings/backup-controller.js"></script>
<script src="/js/settings/permissions-toggle-controller.js"></script>
<script src="/js/settings/dictionary-controller.js"></script> <script src="/js/settings/dictionary-controller.js"></script>
<script src="/js/settings/dictionary-import-controller.js"></script> <script src="/js/settings/dictionary-import-controller.js"></script>
<script src="/js/settings/generic-setting-controller.js"></script> <script src="/js/settings/generic-setting-controller.js"></script>
<script src="/js/settings/keyboard-mouse-input-field.js"></script>
<script src="/js/settings/modal-controller.js"></script> <script src="/js/settings/modal-controller.js"></script>
<script src="/js/settings/modal-jquery.js"></script>
<script src="/js/settings/permissions-toggle-controller.js"></script>
<script src="/js/settings/popup-preview-controller.js"></script> <script src="/js/settings/popup-preview-controller.js"></script>
<script src="/js/settings/profile-conditions-ui.js"></script>
<script src="/js/settings/profile-controller.js"></script> <script src="/js/settings/profile-controller.js"></script>
<script src="/js/settings/scan-inputs-controller.js"></script> <script src="/js/settings/scan-inputs-controller.js"></script>
<script src="/js/settings/scan-inputs-simple-controller.js"></script> <script src="/js/settings/scan-inputs-simple-controller.js"></script>
<script src="/js/settings/settings-controller.js"></script> <script src="/js/settings/settings-controller.js"></script>
<script src="/js/settings/storage-controller.js"></script> <script src="/js/settings/storage-controller.js"></script>
<script src="/js/templates/template-patcher.js"></script>
<script src="/js/templates/template-renderer-proxy.js"></script>
<script src="/js/settings/main.js"></script> <script src="/js/settings/main.js"></script>
</body> </body>

View File

@ -3190,69 +3190,66 @@
<script src="/lib/wanakana.min.js"></script> <script src="/lib/wanakana.min.js"></script>
<script src="/js/core.js"></script> <script src="/js/core.js"></script>
<script src="/js/yomichan.js"></script>
<script src="/js/comm/cross-frame-api.js"></script>
<script src="/js/background/environment.js"></script>
<script src="/js/comm/api.js"></script>
<script src="/js/language/japanese-util.js"></script>
<script src="/js/media/audio-system.js"></script> <script src="/js/yomichan.js"></script>
<script src="/js/general/cache-map.js"></script>
<script src="/js/language/dictionary-data-util.js"></script> <script src="/js/background/environment.js"></script>
<script src="/js/comm/anki.js"></script>
<script src="/js/comm/api.js"></script>
<script src="/js/comm/cross-frame-api.js"></script>
<script src="/js/data/anki-note-builder.js"></script>
<script src="/js/data/database.js"></script>
<script src="/js/data/json-schema.js"></script>
<script src="/js/data/options-util.js"></script>
<script src="/js/data/permissions-util.js"></script>
<script src="/js/dom/document-focus-controller.js"></script> <script src="/js/dom/document-focus-controller.js"></script>
<script src="/js/dom/document-util.js"></script> <script src="/js/dom/document-util.js"></script>
<script src="/js/dom/dom-data-binder.js"></script> <script src="/js/dom/dom-data-binder.js"></script>
<script src="/js/input/hotkey-util.js"></script>
<script src="/js/dom/html-template-collection.js"></script> <script src="/js/dom/html-template-collection.js"></script>
<script src="/js/general/object-property-accessor.js"></script>
<script src="/js/dom/panel-element.js"></script> <script src="/js/dom/panel-element.js"></script>
<script src="/js/dom/popup-menu.js"></script> <script src="/js/dom/popup-menu.js"></script>
<script src="/js/dom/selector-observer.js"></script> <script src="/js/dom/selector-observer.js"></script>
<script src="/js/general/cache-map.js"></script>
<script src="/js/general/object-property-accessor.js"></script>
<script src="/js/general/task-accumulator.js"></script> <script src="/js/general/task-accumulator.js"></script>
<script src="/js/media/text-to-speech-audio.js"></script> <script src="/js/input/hotkey-util.js"></script>
<script src="/js/language/dictionary-data-util.js"></script>
<script src="/js/comm/anki.js"></script>
<script src="/js/data/anki-note-builder.js"></script>
<script src="/js/data/options-util.js"></script>
<script src="/js/data/database.js"></script>
<script src="/js/language/dictionary-database.js"></script> <script src="/js/language/dictionary-database.js"></script>
<script src="/js/language/dictionary-importer.js"></script> <script src="/js/language/dictionary-importer.js"></script>
<script src="/js/data/json-schema.js"></script> <script src="/js/language/japanese-util.js"></script>
<script src="/js/media/audio-system.js"></script>
<script src="/js/media/media-util.js"></script> <script src="/js/media/media-util.js"></script>
<script src="/js/data/permissions-util.js"></script> <script src="/js/media/text-to-speech-audio.js"></script>
<script src="/js/templates/template-patcher.js"></script>
<script src="/js/templates/template-renderer-proxy.js"></script>
<script src="/js/settings/keyboard-mouse-input-field.js"></script>
<script src="/js/settings/profile-conditions-ui.js"></script>
<script src="/js/settings/anki-controller.js"></script> <script src="/js/settings/anki-controller.js"></script>
<script src="/js/settings/anki-templates-controller.js"></script> <script src="/js/settings/anki-templates-controller.js"></script>
<script src="/js/settings/audio-controller.js"></script> <script src="/js/settings/audio-controller.js"></script>
<script src="/js/settings/backup-controller.js"></script> <script src="/js/settings/backup-controller.js"></script>
<script src="/js/settings/permissions-toggle-controller.js"></script>
<script src="/js/settings/dictionary-controller.js"></script> <script src="/js/settings/dictionary-controller.js"></script>
<script src="/js/settings/dictionary-import-controller.js"></script> <script src="/js/settings/dictionary-import-controller.js"></script>
<script src="/js/settings/extension-keyboard-shortcuts-controller.js"></script>
<script src="/js/settings/generic-setting-controller.js"></script> <script src="/js/settings/generic-setting-controller.js"></script>
<script src="/js/settings/keyboard-mouse-input-field.js"></script>
<script src="/js/settings/keyboard-shortcuts-controller.js"></script>
<script src="/js/settings/mecab-controller.js"></script>
<script src="/js/settings/modal.js"></script> <script src="/js/settings/modal.js"></script>
<script src="/js/settings/modal-controller.js"></script> <script src="/js/settings/modal-controller.js"></script>
<script src="/js/settings/nested-popups-controller.js"></script>
<script src="/js/settings/permissions-toggle-controller.js"></script>
<script src="/js/settings/popup-preview-controller.js"></script> <script src="/js/settings/popup-preview-controller.js"></script>
<script src="/js/settings/popup-window-controller.js"></script>
<script src="/js/settings/profile-conditions-ui.js"></script>
<script src="/js/settings/profile-controller.js"></script> <script src="/js/settings/profile-controller.js"></script>
<script src="/js/settings/scan-inputs-controller.js"></script> <script src="/js/settings/scan-inputs-controller.js"></script>
<script src="/js/settings/scan-inputs-simple-controller.js"></script> <script src="/js/settings/scan-inputs-simple-controller.js"></script>
<script src="/js/settings/settings-controller.js"></script>
<script src="/js/settings/status-footer.js"></script>
<script src="/js/settings/storage-controller.js"></script>
<script src="/js/settings/extension-keyboard-shortcuts-controller.js"></script>
<script src="/js/settings/keyboard-shortcuts-controller.js"></script>
<script src="/js/settings/mecab-controller.js"></script>
<script src="/js/settings/nested-popups-controller.js"></script>
<script src="/js/settings/popup-window-controller.js"></script>
<script src="/js/settings/secondary-search-dictionary-controller.js"></script> <script src="/js/settings/secondary-search-dictionary-controller.js"></script>
<script src="/js/settings/sentence-termination-characters-controller.js"></script> <script src="/js/settings/sentence-termination-characters-controller.js"></script>
<script src="/js/settings/settings-controller.js"></script>
<script src="/js/settings/settings-display-controller.js"></script> <script src="/js/settings/settings-display-controller.js"></script>
<script src="/js/settings/status-footer.js"></script>
<script src="/js/settings/storage-controller.js"></script>
<script src="/js/settings/translation-text-replacements-controller.js"></script> <script src="/js/settings/translation-text-replacements-controller.js"></script>
<script src="/js/templates/template-patcher.js"></script>
<script src="/js/templates/template-renderer-proxy.js"></script>
<script src="/js/settings/settings-main.js"></script> <script src="/js/settings/settings-main.js"></script>

View File

@ -20,29 +20,29 @@ self.importScripts(
'/lib/wanakana.min.js', '/lib/wanakana.min.js',
'/js/core.js', '/js/core.js',
'/js/yomichan.js', '/js/yomichan.js',
'/js/background/backend.js',
'/js/background/environment.js', '/js/background/environment.js',
'/js/language/japanese-util.js',
'/js/general/cache-map.js',
'/js/language/dictionary-data-util.js',
'/js/general/object-property-accessor.js',
'/js/comm/anki.js',
'/js/media/audio-downloader.js',
'/js/comm/clipboard-monitor.js',
'/js/comm/clipboard-reader.js',
'/js/data/database.js',
'/js/language/deinflector.js',
'/js/language/dictionary-database.js',
'/js/data/json-schema.js',
'/js/comm/mecab.js',
'/js/media/media-util.js',
'/js/data/options-util.js',
'/js/data/permissions-util.js',
'/js/background/profile-conditions-util.js', '/js/background/profile-conditions-util.js',
'/js/background/request-builder.js', '/js/background/request-builder.js',
'/js/comm/anki.js',
'/js/comm/clipboard-monitor.js',
'/js/comm/clipboard-reader.js',
'/js/comm/mecab.js',
'/js/data/database.js',
'/js/data/json-schema.js',
'/js/data/options-util.js',
'/js/data/permissions-util.js',
'/js/dom/simple-dom-parser.js', '/js/dom/simple-dom-parser.js',
'/js/templates/template-patcher.js', '/js/general/cache-map.js',
'/js/general/object-property-accessor.js',
'/js/general/text-source-map.js', '/js/general/text-source-map.js',
'/js/language/deinflector.js',
'/js/language/dictionary-data-util.js',
'/js/language/dictionary-database.js',
'/js/language/japanese-util.js',
'/js/language/translator.js', '/js/language/translator.js',
'/js/background/backend.js', '/js/media/audio-downloader.js',
'/js/media/media-util.js',
'/js/templates/template-patcher.js',
'/js/background/background-main.js' '/js/background/background-main.js'
); );

View File

@ -13,12 +13,16 @@
<link rel="icon" type="image/png" href="/images/icon128.png" sizes="128x128"> <link rel="icon" type="image/png" href="/images/icon128.png" sizes="128x128">
</head> </head>
<body> <body>
<!-- Scripts -->
<script src="/lib/handlebars.min.js"></script> <script src="/lib/handlebars.min.js"></script>
<script src="/js/data/anki-note-data.js"></script>
<script src="/js/language/dictionary-data-util.js"></script> <script src="/js/language/dictionary-data-util.js"></script>
<script src="/js/language/japanese-util.js"></script> <script src="/js/language/japanese-util.js"></script>
<script src="/js/data/anki-note-data.js"></script>
<script src="/js/templates/template-renderer.js"></script> <script src="/js/templates/template-renderer.js"></script>
<script src="/js/templates/template-renderer-frame-api.js"></script> <script src="/js/templates/template-renderer-frame-api.js"></script>
<script src="/js/templates/template-renderer-frame-main.js"></script> <script src="/js/templates/template-renderer-frame-main.js"></script>
</body> </body>
</html> </html>

View File

@ -315,29 +315,28 @@
<script src="/lib/jszip.min.js"></script> <script src="/lib/jszip.min.js"></script>
<script src="/js/core.js"></script> <script src="/js/core.js"></script>
<script src="/js/yomichan.js"></script>
<script src="/js/comm/cross-frame-api.js"></script>
<script src="/js/comm/api.js"></script>
<script src="/js/general/cache-map.js"></script> <script src="/js/yomichan.js"></script>
<script src="/js/comm/api.js"></script>
<script src="/js/comm/cross-frame-api.js"></script>
<script src="/js/data/database.js"></script>
<script src="/js/data/json-schema.js"></script>
<script src="/js/data/permissions-util.js"></script>
<script src="/js/dom/document-focus-controller.js"></script> <script src="/js/dom/document-focus-controller.js"></script>
<script src="/js/dom/document-util.js"></script> <script src="/js/dom/document-util.js"></script>
<script src="/js/dom/dom-data-binder.js"></script> <script src="/js/dom/dom-data-binder.js"></script>
<script src="/js/input/hotkey-util.js"></script>
<script src="/js/dom/html-template-collection.js"></script> <script src="/js/dom/html-template-collection.js"></script>
<script src="/js/general/object-property-accessor.js"></script>
<script src="/js/dom/panel-element.js"></script> <script src="/js/dom/panel-element.js"></script>
<script src="/js/dom/popup-menu.js"></script> <script src="/js/dom/popup-menu.js"></script>
<script src="/js/dom/selector-observer.js"></script> <script src="/js/dom/selector-observer.js"></script>
<script src="/js/general/cache-map.js"></script>
<script src="/js/general/object-property-accessor.js"></script>
<script src="/js/general/task-accumulator.js"></script> <script src="/js/general/task-accumulator.js"></script>
<script src="/js/input/hotkey-util.js"></script>
<script src="/js/data/database.js"></script>
<script src="/js/language/dictionary-database.js"></script> <script src="/js/language/dictionary-database.js"></script>
<script src="/js/language/dictionary-importer.js"></script> <script src="/js/language/dictionary-importer.js"></script>
<script src="/js/data/json-schema.js"></script>
<script src="/js/media/media-util.js"></script> <script src="/js/media/media-util.js"></script>
<script src="/js/data/permissions-util.js"></script>
<script src="/js/settings/dictionary-controller.js"></script> <script src="/js/settings/dictionary-controller.js"></script>
<script src="/js/settings/dictionary-import-controller.js"></script> <script src="/js/settings/dictionary-import-controller.js"></script>
<script src="/js/settings/generic-setting-controller.js"></script> <script src="/js/settings/generic-setting-controller.js"></script>
@ -345,9 +344,8 @@
<script src="/js/settings/modal-controller.js"></script> <script src="/js/settings/modal-controller.js"></script>
<script src="/js/settings/scan-inputs-simple-controller.js"></script> <script src="/js/settings/scan-inputs-simple-controller.js"></script>
<script src="/js/settings/settings-controller.js"></script> <script src="/js/settings/settings-controller.js"></script>
<script src="/js/settings/status-footer.js"></script>
<script src="/js/settings/settings-display-controller.js"></script> <script src="/js/settings/settings-display-controller.js"></script>
<script src="/js/settings/status-footer.js"></script>
<script src="/js/pages/welcome-main.js"></script> <script src="/js/pages/welcome-main.js"></script>