From 286534e648af350d24fbf3c7892a7ec81aaeb4bd Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 14 Feb 2021 15:53:35 -0500 Subject: Move api to yomichan object (#1392) * Move cross frame API from API to Yomichan * Add API instance to Yomichan * Move api global to yomichan.api * Pass yomichan to API * Remove IIFE --- ext/js/script/dynamic-loader.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'ext/js/script/dynamic-loader.js') diff --git a/ext/js/script/dynamic-loader.js b/ext/js/script/dynamic-loader.js index 0464f151..a2cfb77a 100644 --- a/ext/js/script/dynamic-loader.js +++ b/ext/js/script/dynamic-loader.js @@ -15,10 +15,6 @@ * along with this program. If not, see . */ -/* global - * api - */ - const dynamicLoader = (() => { const injectedStylesheets = new Map(); const injectedStylesheetsWithParent = new WeakMap(); @@ -61,7 +57,7 @@ const dynamicLoader = (() => { } if (type === 'file-content') { - value = await api.getStylesheetContent(value); + value = await yomichan.api.getStylesheetContent(value); type = 'code'; useWebExtensionApi = false; } @@ -73,7 +69,7 @@ const dynamicLoader = (() => { } setInjectedStylesheet(id, parentNode, null); - await api.injectStylesheet(type, value); + await yomichan.api.injectStylesheet(type, value); return null; } -- cgit v1.2.3