Skip to content

Commit

Permalink
Autocorrect doubled text in Firefox themes
Browse files Browse the repository at this point in the history
  • Loading branch information
JustOff committed Feb 11, 2017
1 parent 70ec930 commit efeeccb
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
36 changes: 36 additions & 0 deletions bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,39 @@ function main(aWindow) {
var converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"]
.createInstance(Ci.nsIScriptableUnicodeConverter);
converter.charset = "UTF-8";

var isTheme = /<em:type>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);
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions install.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>[email protected]</em:id>
<em:version>1.0.3</em:version>
<em:version>1.0.4</em:version>
<em:type>2</em:type>
<em:bootstrap>true</em:bootstrap>
<em:name>Moon Tester Tool</em:name>
<em:description>Allows to install any extension, regardless of target application and versions specified in its manifest.</em:description>
<em:description>Allows to install any extension, regardless of target application and versions specified in its manifest. Autocorrect doubled text in Firefox themes.</em:description>
<em:creator>Off JustOff &lt;[email protected]&gt;</em:creator>
<em:homepageURL>https://github.com/JustOff/moon-tester-tool/</em:homepageURL>
<em:targetApplication>
Expand Down

0 comments on commit efeeccb

Please sign in to comment.