Add chrome bug range constant
This commit is contained in:
parent
84e8478831
commit
0478ffee68
|
@ -10,6 +10,9 @@ const VIVALDI = Boolean(chrome.app) && navigator.userAgent.includes('Vivaldi');
|
||||||
// const ANDROID = !chrome.windows;
|
// const ANDROID = !chrome.windows;
|
||||||
let FIREFOX = !chrome.app && parseFloat(navigator.userAgent.match(/\bFirefox\/(\d+\.\d+)|$/)[1]);
|
let FIREFOX = !chrome.app && parseFloat(navigator.userAgent.match(/\bFirefox\/(\d+\.\d+)|$/)[1]);
|
||||||
|
|
||||||
|
// see PR #781
|
||||||
|
const CHROME_HAS_BORDER_BUG = CHROME >= 3167 && CHROME <= 3704;
|
||||||
|
|
||||||
if (!CHROME && !chrome.browserAction.openPopup) {
|
if (!CHROME && !chrome.browserAction.openPopup) {
|
||||||
// in FF pre-57 legacy addons can override useragent so we assume the worst
|
// in FF pre-57 legacy addons can override useragent so we assume the worst
|
||||||
// until we know for sure in the async getBrowserInfo()
|
// until we know for sure in the async getBrowserInfo()
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
/* global messageBox msg setupLivePrefs enforceInputRange
|
/* global messageBox msg setupLivePrefs enforceInputRange
|
||||||
$ $$ $create $createLink
|
$ $$ $create $createLink
|
||||||
FIREFOX OPERA CHROME URLS openURL prefs t API ignoreChromeError */
|
FIREFOX OPERA CHROME URLS openURL prefs t API ignoreChromeError
|
||||||
|
CHROME_HAS_BORDER_BUG */
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
setupLivePrefs();
|
setupLivePrefs();
|
||||||
|
@ -8,7 +9,7 @@ setupRadioButtons();
|
||||||
enforceInputRange($('#popupWidth'));
|
enforceInputRange($('#popupWidth'));
|
||||||
setTimeout(splitLongTooltips);
|
setTimeout(splitLongTooltips);
|
||||||
|
|
||||||
if (CHROME >= 3167 && CHROME <= 3704) {
|
if (CHROME_HAS_BORDER_BUG) {
|
||||||
const borderOption = $('.chrome-no-popup-border');
|
const borderOption = $('.chrome-no-popup-border');
|
||||||
if (borderOption) {
|
if (borderOption) {
|
||||||
borderOption.classList.remove('chrome-no-popup-border');
|
borderOption.classList.remove('chrome-no-popup-border');
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* global configDialog hotkeys onTabReady msg
|
/* global configDialog hotkeys onTabReady msg
|
||||||
getActiveTab FIREFOX getTabRealURL URLS API onDOMready $ $$ prefs CHROME
|
getActiveTab FIREFOX getTabRealURL URLS API onDOMready $ $$ prefs CHROME
|
||||||
setupLivePrefs template t $create tWordBreak animateElement
|
setupLivePrefs template t $create tWordBreak animateElement
|
||||||
tryJSONparse debounce */
|
tryJSONparse debounce CHROME_HAS_BORDER_BUG */
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ prefs.subscribe(['popup.stylesFirst'], (key, stylesFirst) => {
|
||||||
});
|
});
|
||||||
prefs.subscribe(['popupWidth'], (key, value) => setPopupWidth(value));
|
prefs.subscribe(['popupWidth'], (key, value) => setPopupWidth(value));
|
||||||
|
|
||||||
if (CHROME >= 3167 && CHROME <= 3704) {
|
if (CHROME_HAS_BORDER_BUG) {
|
||||||
prefs.subscribe(['popup.borders'], (key, value) => toggleSideBorders(value));
|
prefs.subscribe(['popup.borders'], (key, value) => toggleSideBorders(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ function setPopupWidth(width = prefs.get('popupWidth')) {
|
||||||
function toggleSideBorders(state = prefs.get('popup.borders')) {
|
function toggleSideBorders(state = prefs.get('popup.borders')) {
|
||||||
// runs before <body> is parsed
|
// runs before <body> is parsed
|
||||||
const style = document.documentElement.style;
|
const style = document.documentElement.style;
|
||||||
if (CHROME >= 3167 && CHROME <= 3704 && state) {
|
if (CHROME_HAS_BORDER_BUG && state) {
|
||||||
style.cssText +=
|
style.cssText +=
|
||||||
'border-left: 2px solid white !important;' +
|
'border-left: 2px solid white !important;' +
|
||||||
'border-right: 2px solid white !important;';
|
'border-right: 2px solid white !important;';
|
||||||
|
|
Loading…
Reference in New Issue
Block a user