From efeeccba76b359da85aa99746701f26e591b146d Mon Sep 17 00:00:00 2001 From: JustOff Date: Sat, 11 Feb 2017 20:25:59 +0200 Subject: [PATCH] Autocorrect doubled text in Firefox themes --- bootstrap.js | 36 ++++++++++++++++++++++++++++++++++++ install.rdf | 4 ++-- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/bootstrap.js b/bootstrap.js index b44d053..5bd4939 100644 --- a/bootstrap.js +++ b/bootstrap.js @@ -78,6 +78,39 @@ function main(aWindow) { var converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"] .createInstance(Ci.nsIScriptableUnicodeConverter); converter.charset = "UTF-8"; + + var isTheme = /4<\/em:type>/.test(instData); + if (isTheme) { + instData = instData.replace("[TEST]", "[FIX]"); + var cssFix = "chrome/browser/statusbar/overlay.css"; + var cssData = `@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +#urlbar .urlbar-over-link-layer +{ + opacity: 0; +} + +#urlbar .urlbar-over-link-layer[overlinkstate="fade-in"] +{ + -moz-transition-property: opacity; + -moz-transition-duration: 150ms; + opacity: 1; +} + +#urlbar .urlbar-over-link-layer[overlinkstate="fade-out"] +{ + -moz-transition-property: opacity; + -moz-transition-duration: 150ms; + -moz-transition-timing-function: cubic-bezier(0.0, 1.0, 1.0, 1.0); +} + +#urlbar .urlbar-over-link-layer[overlinkstate="showing"] +{ + opacity: 1; +}`; + var cssStream = converter.convertToInputStream(cssData); + } + inputStream = converter.convertToInputStream(instData); var zw = Cc['@mozilla.org/zipwriter;1'].createInstance(Ci.nsIZipWriter); @@ -89,6 +122,9 @@ function main(aWindow) { } zw.removeEntry(instName, false); zw.addEntryStream(instName, Date.now(), Ci.nsIZipWriter.COMPRESSION_DEFAULT, inputStream, false); + if (isTheme) { + zw.addEntryStream(cssFix, Date.now(), Ci.nsIZipWriter.COMPRESSION_DEFAULT, cssStream, false); + } zw.close(); window = aWindow; diff --git a/install.rdf b/install.rdf index 9328541..d816e63 100644 --- a/install.rdf +++ b/install.rdf @@ -2,11 +2,11 @@ moonttool@Off.JustOff - 1.0.3 + 1.0.4 2 true Moon Tester Tool - Allows to install any extension, regardless of target application and versions specified in its manifest. + Allows to install any extension, regardless of target application and versions specified in its manifest. Autocorrect doubled text in Firefox themes. Off JustOff <Off.Just.Off@gmail.com> https://github.com/JustOff/moon-tester-tool/