diff options
author | Alex Yatskov <alex@foosoft.net> | 2019-12-03 18:30:22 -0800 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2019-12-03 18:30:22 -0800 |
commit | f9ea6206550ceee625ea93215a6e08d45a750086 (patch) | |
tree | 803fe11a788a631076b3fb11a98e50bb8b454396 /ext/fg/js/popup.js | |
parent | 08ad2779678cd447bd747c2b155ef9b5135fdf5d (diff) | |
parent | 3975aabf4dc283d49ec46d0ed7ead982b9fa7441 (diff) |
Merge branch 'master' into testing
Diffstat (limited to 'ext/fg/js/popup.js')
-rw-r--r-- | ext/fg/js/popup.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/fg/js/popup.js b/ext/fg/js/popup.js index 1f9317e0..42475d96 100644 --- a/ext/fg/js/popup.js +++ b/ext/fg/js/popup.js @@ -28,8 +28,8 @@ class Popup { this.childrenSupported = true; this.container = document.createElement('iframe'); this.container.className = 'yomichan-float'; - this.container.addEventListener('mousedown', e => e.stopPropagation()); - this.container.addEventListener('scroll', e => e.stopPropagation()); + this.container.addEventListener('mousedown', (e) => e.stopPropagation()); + this.container.addEventListener('scroll', (e) => e.stopPropagation()); this.container.setAttribute('src', chrome.runtime.getURL('/fg/float.html')); this.container.style.width = '0px'; this.container.style.height = '0px'; @@ -303,7 +303,7 @@ class Popup { } static getColorInfo(cssColor) { - const m = /^\s*rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d\.]+)\s*)?\)\s*$/.exec(cssColor); + const m = /^\s*rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+)\s*)?\)\s*$/.exec(cssColor); if (m === null) { return null; } const m4 = m[4]; @@ -391,7 +391,7 @@ class Popup { static isOnExtensionPage() { try { const url = chrome.runtime.getURL('/'); - return window.location.href.substr(0, url.length) === url; + return window.location.href.substring(0, url.length) === url; } catch (e) { // NOP } @@ -401,7 +401,7 @@ class Popup { if (Popup.outerStylesheet === null) { if (!css) { return; } Popup.outerStylesheet = document.createElement('style'); - Popup.outerStylesheet.id = "yomichan-popup-outer-stylesheet"; + Popup.outerStylesheet.id = 'yomichan-popup-outer-stylesheet'; } const outerStylesheet = Popup.outerStylesheet; |