From 97fd2aa083592df2bca94ceef6a13cdb4be99fcb Mon Sep 17 00:00:00 2001 From: eight Date: Wed, 13 Sep 2017 23:35:34 +0800 Subject: [PATCH] Compat: firefox --- content/install-user-css.css | 1 + edit/source-editor.js | 8 ++++++-- js/dom.js | 9 +++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/content/install-user-css.css b/content/install-user-css.css index d4e73f53..a6ecf9d5 100644 --- a/content/install-user-css.css +++ b/content/install-user-css.css @@ -50,6 +50,7 @@ h1 small { .live-reload { width: fit-content; + width: -moz-fit-content; display: flex; align-items: center; margin: 0.5em auto; diff --git a/edit/source-editor.js b/edit/source-editor.js index e7c02288..e8d14001 100644 --- a/edit/source-editor.js +++ b/edit/source-editor.js @@ -79,8 +79,12 @@ function createSourceEditor(style) { } function setWidgetStyle(widget) { - const borderStyle = style.borderRightWidth !== '0px' ? - style.borderRight : '1px solid ' + style.color; + let borderStyle = ''; + if (style.borderRightWidth !== '0px') { + borderStyle = `${style.borderRightWidth} ${style.borderRightStyle} ${style.borderRightColor}`; + } else { + borderStyle = `1px solid ${style.color}`; + } widget.node.style.backgroundColor = style.backgroundColor; widget.node.style.borderTop = borderStyle; widget.node.style.borderBottom = borderStyle; diff --git a/js/dom.js b/js/dom.js index d72d68cd..81fde80b 100644 --- a/js/dom.js +++ b/js/dom.js @@ -36,9 +36,14 @@ for (const type of [NodeList, NamedNodeMap, HTMLCollection, HTMLAllCollection]) window.addEventListener('resize', () => debounce(addTooltipsToEllipsized, 100)); } -onDOMready().then(() => $('#firefox-transitions-bug-suppressor').remove()); +onDOMready().then(() => { + const el = $('#firefox-transitions-bug-suppressor'); + if (el) { + el.remove(); + } +}); -if (navigator.userAgent.includes('Firefox')) { +if (navigator.userAgent.includes('Firefox') && chrome.windows) { // die if unable to access BG directly chrome.windows.getCurrent(wnd => { if (!BG && wnd.incognito) {