aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/popup.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-04-18 14:12:41 -0400
committerGitHub <noreply@github.com>2020-04-18 14:12:41 -0400
commit106172e2c1261f2d685802280af580c70ac4580b (patch)
tree1e96325ee884db8c946e7401882fd7b46f3552e8 /ext/fg/js/popup.js
parent9e7750125c40d1c4121e8d015957606721bede7c (diff)
parentcdd817a0e1c573b24114836a389236f49dd9b279 (diff)
Merge pull request #447 from toasted-nutbread/util-conversions
Util conversions
Diffstat (limited to 'ext/fg/js/popup.js')
-rw-r--r--ext/fg/js/popup.js11
1 files changed, 1 insertions, 10 deletions
diff --git a/ext/fg/js/popup.js b/ext/fg/js/popup.js
index 42f08afa..99610e17 100644
--- a/ext/fg/js/popup.js
+++ b/ext/fg/js/popup.js
@@ -539,19 +539,10 @@ class Popup {
};
}
- static _isOnExtensionPage() {
- try {
- const url = chrome.runtime.getURL('/');
- return window.location.href.substring(0, url.length) === url;
- } catch (e) {
- // NOP
- }
- }
-
static async _injectStylesheet(id, type, value, useWebExtensionApi) {
const injectedStylesheets = Popup._injectedStylesheets;
- if (Popup._isOnExtensionPage()) {
+ if (yomichan.isExtensionUrl(window.location.href)) {
// Permissions error will occur if trying to use the WebExtension API to inject
// into an extension page.
useWebExtensionApi = false;