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;
|
||||
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) {
|
||||
// in FF pre-57 legacy addons can override useragent so we assume the worst
|
||||
// until we know for sure in the async getBrowserInfo()
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/* global messageBox msg setupLivePrefs enforceInputRange
|
||||
$ $$ $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';
|
||||
|
||||
setupLivePrefs();
|
||||
|
@ -8,7 +9,7 @@ setupRadioButtons();
|
|||
enforceInputRange($('#popupWidth'));
|
||||
setTimeout(splitLongTooltips);
|
||||
|
||||
if (CHROME >= 3167 && CHROME <= 3704) {
|
||||
if (CHROME_HAS_BORDER_BUG) {
|
||||
const borderOption = $('.chrome-no-popup-border');
|
||||
if (borderOption) {
|
||||
borderOption.classList.remove('chrome-no-popup-border');
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* global configDialog hotkeys onTabReady msg
|
||||
getActiveTab FIREFOX getTabRealURL URLS API onDOMready $ $$ prefs CHROME
|
||||
setupLivePrefs template t $create tWordBreak animateElement
|
||||
tryJSONparse debounce */
|
||||
tryJSONparse debounce CHROME_HAS_BORDER_BUG */
|
||||
|
||||
'use strict';
|
||||
|
||||
|
@ -43,7 +43,7 @@ prefs.subscribe(['popup.stylesFirst'], (key, stylesFirst) => {
|
|||
});
|
||||
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));
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,7 @@ function setPopupWidth(width = prefs.get('popupWidth')) {
|
|||
function toggleSideBorders(state = prefs.get('popup.borders')) {
|
||||
// runs before <body> is parsed
|
||||
const style = document.documentElement.style;
|
||||
if (CHROME >= 3167 && CHROME <= 3704 && state) {
|
||||
if (CHROME_HAS_BORDER_BUG && state) {
|
||||
style.cssText +=
|
||||
'border-left: 2px solid white !important;' +
|
||||
'border-right: 2px solid white !important;';
|
||||
|
|
Loading…
Reference in New Issue
Block a user