Problems with script #135
Unanswered
NoNameNeeded2
asked this question in
General Support
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
I use the rebuild_userChrome.uc.js as a script manager in Firefox but there is a problem with one script.
When you select it, it works but the next time Firefox starts it's no longer there (it's a download button and a downloads window). You have to unselect it, restart Firefox and then select it again.
This is the script in question:
`// Downloadbutton.uc.js
(function() {
if (window.__SSi != 'window0') return;
try {
CustomizableUI.createWidget({
id: 'Download-button',
type: 'custom',
defaultArea: CustomizableUI.AREA_NAVBAR,
onBuild: function(aDocument) {
var toolbaritem = aDocument.createElementNS('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul', 'toolbarbutton');
var props = {
id: 'Download-button',
class: 'toolbarbutton-1 chromeclass-toolbar-additional',
removable: true,
label: 'Downloads',
accesskey: 'D',
tooltiptext: 'Downloads',
style: 'list-style-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAASCAYAAABfJS4tAAAACXBIWXMAAA7EAAAOxAGVKw4bAAABtUlEQVR42qWUsW4UMRiEZ2wH8QARIiWi4R4hF53OPTWPQZMSJEpKGniHSNAgRInEf0UuBUUkGqqI7pIiLdIpWB4a+3CcXS6Am7V37e+fGdvLxWLB+XzuzSzhPxtJSlKMMdDMrn2MMT5p5wJQHZjZu9sWCD1U0quRybMYo8yMt1EdBqAvyoTPAAKABACSfgC4R3IDjzGGPkJJAgCaWW//bzKVpN7BWzP7HcVYBP9QDChWAWAN4H7pp/L+qDy/DAEkfWpgF845SZoCeN+CWzvtzqdtUO/9eS8aANwWW+umf0ZyQnLinPvZQ4vaTevBRz2U5KQsfJhzfg3gI4BDkhcNdJ/k8k/gG0rL+FG1n3P+DkDOOVWlJE96xWGAeyopAQgkJ5K+Vahz7mmj8mUp+qzAly28V3zaFyR5VjMtUbROBqFbN6+AHgM4dM498N6fS3reQiXdiGEsimvHKef8pt19kvsVGkI4JnkwxHBAvAvcwdjZLSqne3ve7+xoVm2HEI5TSgdjbotiqlfaQkkuLy/TbHc3LFerNJV0Mqa0AdsaiB/KHf86Eg2uroDVKm1+PvWG1Surbs0vwI32T0LSlTkAAAAASUVORK5CYII=)',
oncommand: "window.open('chrome://browser/content/downloads/contentAreaDownloadsView.xhtml', 'Downloads', 'chrome,resizable=yes,width=600,height=340,left=440,top=250');"
};
for (var p in props)
toolbaritem.setAttribute(p, props[p]);
return toolbaritem;
}
});
CustomizableUI.registerToolbarNode(tb);
} catch(e) { };
Downloads.getList(Downloads.ALL)
.then(list => list.addView({
onDownloadAdded: () =>
Services.wm.getMostRecentBrowserWindow().document.getElementById('Download-button').click()
}));
})();`
Beta Was this translation helpful? Give feedback.
All reactions