require FF >= 55
This commit is contained in:
parent
f966b2ef96
commit
d048c480c3
|
@ -176,12 +176,6 @@ chrome.runtime.onInstalled.addListener(({reason, previousVersion}) => {
|
||||||
if (UA.mobile) prefs.set('manage.newUI', false);
|
if (UA.mobile) prefs.set('manage.newUI', false);
|
||||||
if (UA.windows) prefs.set('editor.keyMap', 'sublime');
|
if (UA.windows) prefs.set('editor.keyMap', 'sublime');
|
||||||
}
|
}
|
||||||
if (reason === 'update') {
|
|
||||||
const [a, b, c] = (previousVersion || '').split('.');
|
|
||||||
if (a <= 1 && b <= 5 && c <= 13) { // 1.5.13
|
|
||||||
require(['/background/remove-unused-storage']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// TODO: remove this before 1.5.23 as it's only for a few users who installed git 26b75e77
|
// TODO: remove this before 1.5.23 as it's only for a few users who installed git 26b75e77
|
||||||
if (reason === 'update' && previousVersion === '1.5.22') {
|
if (reason === 'update' && previousVersion === '1.5.22') {
|
||||||
for (const dbName of ['drafts', prefs.STORAGE_KEY]) {
|
for (const dbName of ['drafts', prefs.STORAGE_KEY]) {
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
/* global chromeLocal */// storage-util.js
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
// Removing unused stuff from storage on extension update
|
|
||||||
// TODO: delete this by the middle of 2021
|
|
||||||
|
|
||||||
try {
|
|
||||||
localStorage.clear();
|
|
||||||
} catch (e) {}
|
|
||||||
|
|
||||||
setTimeout(async () => {
|
|
||||||
const del = Object.keys(await chromeLocal.get())
|
|
||||||
.filter(key => key.startsWith('usoSearchCache'));
|
|
||||||
if (del.length) chromeLocal.remove(del);
|
|
||||||
}, 15e3);
|
|
|
@ -43,17 +43,14 @@
|
||||||
/* about:blank iframes are often used by sites for file upload or background tasks
|
/* about:blank iframes are often used by sites for file upload or background tasks
|
||||||
* and they may break if unexpected DOM stuff is present at `load` event
|
* and they may break if unexpected DOM stuff is present at `load` event
|
||||||
* so we'll add the styles only if the iframe becomes visible */
|
* so we'll add the styles only if the iframe becomes visible */
|
||||||
const {IntersectionObserver} = window;
|
|
||||||
const xoEventId = `${Math.random()}`;
|
const xoEventId = `${Math.random()}`;
|
||||||
/** @type IntersectionObserver */
|
/** @type IntersectionObserver */
|
||||||
let xo;
|
let xo;
|
||||||
if (IntersectionObserver) {
|
window[Symbol.for('xo')] = (el, cb) => {
|
||||||
window[Symbol.for('xo')] = (el, cb) => {
|
if (!xo) xo = new IntersectionObserver(onIntersect, {rootMargin: '100%'});
|
||||||
if (!xo) xo = new IntersectionObserver(onIntersect, {rootMargin: '100%'});
|
el.addEventListener(xoEventId, cb, {once: true});
|
||||||
el.addEventListener(xoEventId, cb, {once: true});
|
xo.observe(el);
|
||||||
xo.observe(el);
|
};
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// Declare all vars before init() or it'll throw due to "temporal dead zone" of const/let
|
// Declare all vars before init() or it'll throw due to "temporal dead zone" of const/let
|
||||||
const ready = init();
|
const ready = init();
|
||||||
|
@ -246,11 +243,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function onFrameElementInView(cb) {
|
function onFrameElementInView(cb) {
|
||||||
if (IntersectionObserver) {
|
parent[parent.Symbol.for('xo')](frameElement, cb);
|
||||||
parent[parent.Symbol.for('xo')](frameElement, cb);
|
|
||||||
} else {
|
|
||||||
requestAnimationFrame(cb);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @param {IntersectionObserverEntry[]} entries */
|
/** @param {IntersectionObserverEntry[]} entries */
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
|
|
||||||
globalSetOption(key, value) {
|
globalSetOption(key, value) {
|
||||||
CodeMirror.defaults[key] = value;
|
CodeMirror.defaults[key] = value;
|
||||||
if (cms.size > 4 && lazyOpt && lazyOpt.names.includes(key)) {
|
if (cms.size > 4 && lazyOpt.names.includes(key)) {
|
||||||
lazyOpt.set(key, value);
|
lazyOpt.set(key, value);
|
||||||
} else {
|
} else {
|
||||||
cms.forEach(cm => cm.setOption(key, value));
|
cms.forEach(cm => cm.setOption(key, value));
|
||||||
|
@ -104,7 +104,7 @@
|
||||||
|
|
||||||
// lazy propagation
|
// lazy propagation
|
||||||
|
|
||||||
lazyOpt = window.IntersectionObserver && {
|
lazyOpt = {
|
||||||
names: ['theme', 'lineWrapping'],
|
names: ['theme', 'lineWrapping'],
|
||||||
set(key, value) {
|
set(key, value) {
|
||||||
const {observer, queue} = lazyOpt;
|
const {observer, queue} = lazyOpt;
|
||||||
|
|
|
@ -60,14 +60,9 @@
|
||||||
const body = pw.document.body;
|
const body = pw.document.body;
|
||||||
pw.on('keydown', removePopupOnEsc);
|
pw.on('keydown', removePopupOnEsc);
|
||||||
pw.close = removePopup;
|
pw.close = removePopup;
|
||||||
if (pw.IntersectionObserver) {
|
new pw.IntersectionObserver(onIntersect).observe(body.appendChild(
|
||||||
new pw.IntersectionObserver(onIntersect).observe(body.appendChild(
|
$create('div', {style: {height: '1px', marginTop: '-1px'}})
|
||||||
$create('div', {style: {height: '1px', marginTop: '-1px'}})
|
));
|
||||||
));
|
|
||||||
} else {
|
|
||||||
frame.dataset.loaded = '';
|
|
||||||
frame.height = body.scrollHeight;
|
|
||||||
}
|
|
||||||
new pw.MutationObserver(onMutation).observe(body, {
|
new pw.MutationObserver(onMutation).observe(body, {
|
||||||
attributes: true,
|
attributes: true,
|
||||||
attributeFilter: ['style'],
|
attributeFilter: ['style'],
|
||||||
|
|
|
@ -16,8 +16,7 @@ function SectionsEditor() {
|
||||||
const container = $('#sections');
|
const container = $('#sections');
|
||||||
/** @type {EditorSection[]} */
|
/** @type {EditorSection[]} */
|
||||||
const sections = [];
|
const sections = [];
|
||||||
const xo = window.IntersectionObserver &&
|
const xo = new IntersectionObserver(refreshOnViewListener, {rootMargin: '100%'});
|
||||||
new IntersectionObserver(refreshOnViewListener, {rootMargin: '100%'});
|
|
||||||
let INC_ID = 0; // an increment id that is used by various object to track the order
|
let INC_ID = 0; // an increment id that is used by various object to track the order
|
||||||
let sectionOrder = '';
|
let sectionOrder = '';
|
||||||
let headerOffset; // in compact mode the header is at the top so it reduces the available height
|
let headerOffset; // in compact mode the header is at the top so it reduces the available height
|
||||||
|
@ -632,7 +631,7 @@ function SectionsEditor() {
|
||||||
if (code) {
|
if (code) {
|
||||||
linterMan.enableForEditor(cm, code);
|
linterMan.enableForEditor(cm, code);
|
||||||
}
|
}
|
||||||
if (force || !xo) {
|
if (force) {
|
||||||
refreshOnViewNow(cm);
|
refreshOnViewNow(cm);
|
||||||
} else {
|
} else {
|
||||||
xo.observe(cm.display.wrapper);
|
xo.observe(cm.display.wrapper);
|
||||||
|
|
18
global.css
18
global.css
|
@ -359,20 +359,6 @@ body.resizing-v > * {
|
||||||
}
|
}
|
||||||
|
|
||||||
@supports (-moz-appearance: none) {
|
@supports (-moz-appearance: none) {
|
||||||
.moz-appearance-bug .svg-icon.checked,
|
|
||||||
.moz-appearance-bug .onoffswitch input,
|
|
||||||
.moz-appearance-bug input[type="radio"]:after {
|
|
||||||
display: none !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.moz-appearance-bug input[type="checkbox"] {
|
|
||||||
-moz-appearance: checkbox !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.moz-appearance-bug input[type="radio"] {
|
|
||||||
-moz-appearance: radio !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.firefox select {
|
.firefox select {
|
||||||
padding: 0 20px 0 2px;
|
padding: 0 20px 0 2px;
|
||||||
line-height: var(--input-height)!important;
|
line-height: var(--input-height)!important;
|
||||||
|
@ -400,10 +386,6 @@ body.resizing-v > * {
|
||||||
border: 1px solid hsl(0, 0%, 66%);
|
border: 1px solid hsl(0, 0%, 66%);
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.firefox.moz-appearance-bug button:not(.install) {
|
|
||||||
padding: 2px 4px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 850px) {
|
@media (max-width: 850px) {
|
||||||
|
|
|
@ -46,15 +46,13 @@ const [CHROME, UA] = (() => {
|
||||||
// see PR #781
|
// see PR #781
|
||||||
const CHROME_POPUP_BORDER_BUG = CHROME >= 62 && CHROME <= 74;
|
const CHROME_POPUP_BORDER_BUG = CHROME >= 62 && CHROME <= 74;
|
||||||
|
|
||||||
if (!CHROME && !chrome.browserAction.openPopup) {
|
if (FIREFOX && !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()
|
||||||
// (browserAction.openPopup was added in 57)
|
// (browserAction.openPopup was added in 57)
|
||||||
FIREFOX = browser.runtime.getBrowserInfo ? 51 : 50;
|
FIREFOX = 55; // from strict_min_version
|
||||||
// getBrowserInfo was added in FF 51
|
browser.runtime.getBrowserInfo().then(info => {
|
||||||
Promise.resolve(FIREFOX >= 51 ? browser.runtime.getBrowserInfo() : {version: 50}).then(info => {
|
|
||||||
FIREFOX = parseFloat(info.version);
|
FIREFOX = parseFloat(info.version);
|
||||||
document.documentElement.classList.add('moz-appearance-bug', FIREFOX && FIREFOX < 54);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,7 @@
|
||||||
"applications": {
|
"applications": {
|
||||||
"gecko": {
|
"gecko": {
|
||||||
"id": "{7a7a4a92-a2a0-41d1-9fd7-1e92480d612d}",
|
"id": "{7a7a4a92-a2a0-41d1-9fd7-1e92480d612d}",
|
||||||
"strict_min_version": "53.0"
|
"strict_min_version": "55.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2ypG+Z/beZtoYrxxwXYhMwQiAiwRVnSHqdpOSzJdjsXVWdvJjlgEuZcU8kte75w58P45LsRUrwvU6N9x12S6eW84KNEBC8rlZj0RGNoxuhSAcdxneYzjJ9tBkZKOidVedYHHsi3LeaXiLuTNTBR+2lf3uCNcP0ebaFML9uDLdYTGEW4eL3hnEKYPSmT1/xkh4bSGTToCg4YNuWWWoTA0beEOpBWYkPVMarLDQgPzMN5Byu5w3lOS2zL0PPJcmdyk3ez/ZsB4PZKU+h17fVA6+YTvUfxUqLde5i2RiuZhEb6Coo5/W90ZW1yCDC9osjWrxMGYeUMQWHPIgFtDhk4K6QIDAQAB"
|
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2ypG+Z/beZtoYrxxwXYhMwQiAiwRVnSHqdpOSzJdjsXVWdvJjlgEuZcU8kte75w58P45LsRUrwvU6N9x12S6eW84KNEBC8rlZj0RGNoxuhSAcdxneYzjJ9tBkZKOidVedYHHsi3LeaXiLuTNTBR+2lf3uCNcP0ebaFML9uDLdYTGEW4eL3hnEKYPSmT1/xkh4bSGTToCg4YNuWWWoTA0beEOpBWYkPVMarLDQgPzMN5Byu5w3lOS2zL0PPJcmdyk3ez/ZsB4PZKU+h17fVA6+YTvUfxUqLde5i2RiuZhEb6Coo5/W90ZW1yCDC9osjWrxMGYeUMQWHPIgFtDhk4K6QIDAQAB"
|
||||||
|
|
|
@ -256,7 +256,7 @@
|
||||||
if (results.length && 'empty' in dom.container.dataset) {
|
if (results.length && 'empty' in dom.container.dataset) {
|
||||||
delete dom.container.dataset.empty;
|
delete dom.container.dataset.empty;
|
||||||
}
|
}
|
||||||
if (scrollToFirstResult && (!FIREFOX || FIREFOX >= 55)) {
|
if (scrollToFirstResult) {
|
||||||
debounce(doScrollToFirstResult);
|
debounce(doScrollToFirstResult);
|
||||||
}
|
}
|
||||||
// navigation
|
// navigation
|
||||||
|
|
Loading…
Reference in New Issue
Block a user