From 82d2530669513b1642aec851da6f99ea2dece6a0 Mon Sep 17 00:00:00 2001 From: vVde3S88xHW6EZaB63HyXQUipgFtaWooYGDs35g <82120463+vVde3S88xHW6EZaB63HyXQUipgFtaWooYGDs35g@users.noreply.github.com> Date: Thu, 8 Apr 2021 09:45:43 +0200 Subject: [PATCH 1/6] fix installer for local files in FF (#1224) --- install-usercss/preinit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install-usercss/preinit.js b/install-usercss/preinit.js index 700c2809..6f37f2e0 100644 --- a/install-usercss/preinit.js +++ b/install-usercss/preinit.js @@ -19,7 +19,7 @@ const preinit = (() => { .catch(getData); } else { getData = PortDownloader(); - firstGet = getData({timer: false}); + firstGet = getData({force: true}); } function DirectDownloader() { From a934571dc7443538f4724812c86ed60def4e2048 Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 8 Apr 2021 09:49:24 +0200 Subject: [PATCH 2/6] update setup-node plugin to v2 (#1215) --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f006694c..1dddcfb6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v2 with: node-version: '14' - run: npm install From 0b9b972338cf60211f425296a95e286f82a35e2c Mon Sep 17 00:00:00 2001 From: tophf Date: Thu, 8 Apr 2021 14:30:50 +0300 Subject: [PATCH 3/6] update swatch's lines to match current code --- js/color/color-view.js | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/js/color/color-view.js b/js/color/color-view.js index b4914cdc..c8143ecd 100644 --- a/js/color/color-view.js +++ b/js/color/color-view.js @@ -585,7 +585,22 @@ if (palette.size > 1 || nums && nums.length > 1) { const old = new Map((options.popup.palette || []).map(el => [el.__color, el])); for (const [color, data] of palette) { - res.push(old.get(color) || makePaletteSwatch(color, data, options.popup.paletteLine)); + const str = data.join(', '); + let el = old.get(color); + if (!el) { + el = document.createElement('div'); + el.__color = color; // also used in color-picker.js + el.className = COLORVIEW_SWATCH_CLASS; + el.style.setProperty(`--${COLORVIEW_SWATCH_CLASS}`, color); + } + if (el.__str !== str) { + el.__str = str; + // break down long lists: 10 per line + el.title = `${color}\n${options.popup.paletteLine} ${ + str.length > 50 ? str.replace(/([^,]+,\s){10}/g, '$&\n') : str + }`; + } + res.push(el); } res.push(Object.assign(document.createElement('span'), { className: 'colorpicker-palette-hint', @@ -596,17 +611,6 @@ return res; } - function makePaletteSwatch(color, nums, label) { - const s = nums.join(', '); - const el = document.createElement('div'); - el.className = COLORVIEW_SWATCH_CLASS; - el.style.cssText = COLORVIEW_SWATCH_CSS + color; - // break down long lists: 10 per line - el.title = `${color}\n${label} ${s.length > 50 ? s.replace(/([^,]+,\s){10}/g, '$&\n') : s}`; - el.__color = color; - return el; - } - function paletteCallback(el) { const {cm} = this; const lines = el.title.split('\n')[1].match(/\d+/g).map(Number); From baca54bf19c940634b4c064ec81a0d1e50d4be57 Mon Sep 17 00:00:00 2001 From: Rob Garrison Date: Sun, 18 Apr 2021 20:06:24 -0500 Subject: [PATCH 4/6] Add privacy policy --- privacy-policy.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 privacy-policy.md diff --git a/privacy-policy.md b/privacy-policy.md new file mode 100644 index 00000000..a029f1ae --- /dev/null +++ b/privacy-policy.md @@ -0,0 +1,7 @@ +# Privacy Policy + +No data or personal information is collected by Stylus. + +## Contact + +If you have any questions or suggestions regarding this privacy policy, do not hesitate to [contact us](stylus.openstyles@gmail.com). From 43f1da1b4c5fc0c1b7012e6b4071c329dc2e7b2e Mon Sep 17 00:00:00 2001 From: Rob Garrison Date: Sun, 18 Apr 2021 20:15:07 -0500 Subject: [PATCH 5/6] copy policy from app details --- privacy-policy.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/privacy-policy.md b/privacy-policy.md index a029f1ae..02fa1ac3 100644 --- a/privacy-policy.md +++ b/privacy-policy.md @@ -1,6 +1,8 @@ # Privacy Policy -No data or personal information is collected by Stylus. +Unlike other similar extensions, we don't find you to be all that interesting. Your questionable browsing history should remain between you and the NSA. Stylus collects nothing. Period. + +Again, **no data or personal information is collected by Stylus**. ## Contact From 711f6502b59f8dfae1375c9d790fdb40f4580166 Mon Sep 17 00:00:00 2001 From: tophf Date: Mon, 19 Apr 2021 16:01:36 +0300 Subject: [PATCH 6/6] make transition suppressor rule more robust --- global.css | 7 +++---- js/dom.js | 12 ++++++++++-- tools/test.js | 4 ++-- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/global.css b/global.css index 5cf9f3a2..4c52364f 100644 --- a/global.css +++ b/global.css @@ -1,7 +1,6 @@ -html#stylus #header *:not(#\0) { - /* This suppresses transitions on page open. - * WARNING! Must be the first rule here so dom.js can simply call deleteRule for index 0. - * Using an increased specificity to override sane selectors in user styles */ +html#stylus #header *:not(#\0transition-suppressor) { + /* This suppresses a bug in all? browsers: they apply transitions during page load. + * Using an increased specificity to override sane selectors in user styles. */ transition: none !important; } body { diff --git a/js/dom.js b/js/dom.js index ada2f408..d4111554 100644 --- a/js/dom.js +++ b/js/dom.js @@ -437,8 +437,16 @@ async function waitForSheet({ window.on('resize', () => debounce(addTooltipsToEllipsized, 100)); }); - // Using `load` event as we need transition bug suppressor active until everything loads - window.on('load', () => $('link[href^="global.css"]').sheet.deleteRule(0), {once: true}); + window.on('load', () => { + const {sheet} = $('link[href^="global.css"]'); + for (let i = 0, rule; (rule = sheet.cssRules[i]); i++) { + // Not using \0 in the id as it's converted to \xFFFD, probably a bug + if (/#.transition-suppressor/.test(rule.selectorText)) { + sheet.deleteRule(i); + break; + } + } + }, {once: true}); function addFaviconFF() { const iconset = ['', 'light/'][prefs.get('iconset')] || ''; diff --git a/tools/test.js b/tools/test.js index 0134ac58..abee1c79 100644 --- a/tools/test.js +++ b/tools/test.js @@ -6,8 +6,8 @@ testGlobalCss(); function testGlobalCss() { const css = fs.readFileSync('global.css', {encoding: 'utf8'}); - const ERR = 'global.css: the first rule must be the transition suppressor'; - const RX_SUPPRESSOR = /^[^{}]+{\s*transition:\s*none\s*!\s*important/i; + const ERR = 'global.css: missing the transition suppressor rule'; + const RX_SUPPRESSOR = /[^{}]+#\\0transition-suppressor[^{}]+{\s*transition:\s*none\s*!\s*important/i; const RX_COMMENT = /\/\*([^*]|\*(?!\/))*(\*\/|$)/g; if (!RX_SUPPRESSOR.test(css.replace(RX_COMMENT, ''))) { console.error(ERR);