xiaoxiaoflood / firefox-scripts Goto Github PK
View Code? Open in Web Editor NEWuserChromeJS / autoconfig.js and extensions
License: Mozilla Public License 2.0
userChromeJS / autoconfig.js and extensions
License: Mozilla Public License 2.0
Hi xiaoxiaoflood,
I'm trying to convert an older legacy extension to a userscript:
https://addons.mozilla.org/en-US/firefox/addon/auto-focus-url-bar/
Source:
https://pastebin.com/bNpXZDN1
It appears that this script only works with e10s disabled and I'm not sure how to convert it to get it working with e10s. Some APIs probably need to replaced, but I'm not familiar enough with XUL to get it working:
https://developer.mozilla.org/en-US/docs/Archive/Add-ons/Add-on_SDK/Guides/XUL_Migration_Guide#Using_XPCOM
Any help would be appreciated.
Hi,
I clicked on an option that not remember the name(inside that extension) and now I dont have access to this button(is hidden but working, because firefox aks me for a password). How can I see aggain the button?
Would occasionally be useful; in particular, I want to try to add a "copy as httpie" in addition to the "copy as curl". There are a few other minor ideas I've been toying with too, but have no way to implement.
I have no idea how to go about this though — the page inspector (F12) is just an iframe, but I have no idea about the browser inspector (C-S-I).
Hi, just a FYI: firefox 73.0b3 loads custom user scripts just fine without
pref("general.config.sandbox_enabled", false);
I haven't found an official URL on Mozilla/MDN (yet) that documents this change, but it works nonetheless. Might give users a more relaxed feeling knowing that nothing relating to the FF sandbox needs to be disabled...
Does anyone know if this project is still active? I am able to still use script buttons with the change made in v69 to userChrome.jsm. Thanks to flandy for that. But I do miss some legacy addons like private tab and downthemall in the latest nightly. Given the code changes is it even possible to keep them working any longer?
Hi, with press CTRL+MID the script is enable/disabled and opened the home page, so:
in line 82
this.toggleScript(script);
event.target.setAttribute('checked', script.isEnabled);
Need "else"
else {
this.toggleScript(script);
event.target.setAttribute('checked', script.isEnabled);
}
The tools menu is pretty hidden away on current versions of Firefox, only accessible through a shortcut key, so I was thinking a middle-ground between too visible (a toolbar button) and too hidden would be to have the menu on the main menu, perhaps below the Add-ons entry? Or is modifying this menu too much of a pain?
Could I elevate the privilege of an iframe so it can load dtds to its src?
Just like this function did with the XMLHttpRequest()?
fetchOverlay(srcUrl) {
if (!srcUrl.startsWith("chrome://") && !srcUrl.startsWith("resource://")) {
throw new Error(
"May only load overlays from chrome:// or resource:// uris"
);
}
let xhr = new this.window.XMLHttpRequest();
xhr.overrideMimeType("application/xml");
xhr.open("GET", srcUrl, false);
// Elevate the request, so DTDs will work. Should not be a security issue since we
// only load chrome, resource and file URLs, and that is our privileged chrome package.
try {
xhr.channel.owner = Services.scriptSecurityManager.getSystemPrincipal();
} catch (ex) {
oconsole.error(
"Failed to set system principal while fetching overlay " + srcUrl
);
xhr.close();
throw new Error("Failed to set system principal");
}
xhr.send(null);
return xhr;
}
Hi, im trying to add this lines:
d=document;b=d.body;o=d.createElement('scri'+'pt');o.setAttribute('src','https://translate.google.cn/translate_a/element.js?cb=googleTranslateElementInit');o.setAttribute('type','text/javascript');b.appendChild(o);v=b.insertBefore(d.createElement('div'),b.firstChild);v.id='google_translate_element';v.style.display='none';p=d.createElement('scri'+'pt');p.text='function googleTranslateElementInit(){new google.translate.TranslateElement({pageLanguage:""},"google_translate_element");}';p.setAttribute('type','text/javascript');b.appendChild(p);
To a script, for run injected on the web page. But i do not know how do that... need use loadURI, but not load...
That lines inject google translate on the page (can test adding to a bookmark and pressing then the google translate appear... so, i wanna do a script (in context menu)) (Note: need add javascript:{ LINES }void 0
Appreciate your help =)
Step to reproduce:
and bah, userChromeJSManager not work.
Fx68 here and got this error message in browser console:
styloaix.uc.js
TypeError : _uc.sss is undefined styloaix.uc.js:343
Hello, first of all I'd like to thank you for sharing your work. As I can see you have scroll to top action bound in gestures script but I can't get it to work any way, most likely it should replicate scroll to bottom (sending keystroke), but I can't figure out what would be the code for Home
button (obviously changing 23
to 24
in that number doesn't work). Do you have any reference how to find these codes?
I just found this project - thank you for the loader, works fine on FF71.
Two suggestions:
Add an instruction to delete startupCache
when installing the script. Did not work for me without.
Put the config-prefs.js
file from the installation-folder
folder to the correct subfolder, so it's easier to extract.
Hi,
I'd like to show files downloaded with DownThemAll in S3Download status bar.
Are you interested in adding this feature?
Hi, check
https://developer.mozilla.org/en-US/docs/Tools/Scratchpad
So, need set a default editor on launchEditor: function (script) (for windows notepad)
Hey mate,
Any ideas of converting News Fox?
It was the best known rss reader, simple and stable. Shouldn't cause troubles with adding bootstrap, only basic functions, nothing more.
All those new rss readers are pain in ass and add tons of shit to \storage\default\ (indexxdb or something)
Care to try?
https://addons.mozilla.org/en-US/firefox/addon/newsfox/
1.0.9.4.1
Thanks for your hard work, SaveFileTo/Greasemonkey/Keyconfig/Stylish/RehostImg are my beloved and used in everyday browsing.
DTA seems not to be stable :( , lots of issues, can post some if needed.
It would be really hard once they remove xbl support :(
Hello,
first thank you very much for your work with the scripts. I use 5-6 of them already. :-)
Could you write a script which clears the search bar after the search (pressing ENTER)? Until FF v77 I used the old script Clear Search Word by ardiman with your userChrome.js method. Sadly it stopped working with FF v78.
Any chance that you could provide a similar script for FF v78 and above?
Thank you very much in advance.
Hi,
right click to edit the script does not work
Hello, In new FX this was removed:
https://bugzilla.mozilla.org/show_bug.cgi?id=1430009
https://bugzilla.mozilla.org/show_bug.cgi?id=1428938
So now this not work: statusbar.setAttribute('toolboxid', 'navigator-toolbox');
and also win.gNavToolbox.externalToolbars
. Description for that attrs:
https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/toolbar#a-toolbarname
https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/toolbox#p-externalToolbars
Is there any easy way to restore that option? I mean show/hide our new toolbar in standard context menu (#toolbar-context-menu)? I see this context is made dynamically, and use global onViewToolbarsPopupShowing()
. This method use gNavToolbox.querySelectorAll("toolbar");
but our toolbar not exist any more for navigator-toolbox
. When I manually add menuitem
to toolbar-context-menu
it was removed when we open that popup (because invoking onViewToolbarsPopupShowing
works like that).
It would be nice to find some internal solution which would apply also to Menu Bar (View) or customization pallet (in this places we can make show/hide for our toolbars).
Hi, now when we click Ctrl+Left Mouse on a given script we make reload this script (the same as turn off + turn on) but we operate with old cached script version. So every change done in our script need reload browser but it's pain always and always reload all browser (it's to heavy, especially when we have open more windows).
What if you add next option for reload, same as Ctrl+Left Mouse, but before that action you will remove all profile\startupCache content. I noticed that when I do this manually then Ctrl+Left Mouse reload script with actual change.
Hello,
it seems, that this script doesn't work anymore. I testet it with FF v74 and v68.6 ESR (under Windows 10). There is no entry under the toolbars menu. If you have the time, could you take a look at this?
Thank you in advance. :-)
Greets
im using firefox ver 80.1 and do as you write, nothing happen, there are not startupCache file for me to delete.
Hi,
I use your scripts and I'm very satisfied.
I have a minor issue and I'm embarrassed to ask your help, but I hope you can help me.
Yesterday I was editing a script opened from your icon contextual menu in Firefox and I don't know how the notepad switched to a black theme. (Here a picture https://imgur.com/EC9YOCZ)
I don't like it and I don't know how reverting this change
Could you give some support to Waterfox Current that natively supports this format of legacy add-ons? It's based on Fx 68 though, so there might be so incomability with Fx 75.
I already use Stylish and DownThemAll from you. Though the newest version of DTA for Fx75 doesn't work here I use version 3.1.2.68.2019.07.01-xiao. Though it doesn't have a progressbar for downloaded files. I don't if that suppose to be or there is a more compatible version that would display progressbar while downloading?
Besides that would be possible for you to rewrite some other important add-ons? The one most important for me is TabMixPlus, but also FlashGot and Custom Buttons. I've already requested developers of those add-ons to rewrite them, but in case they wouldn't agree, could you do it? Please consider my request.
Hello,
thanks a lot for bringing back the old password manager. I was directed here by another user.
I'm not using anything else from your Repo, so my question is what are the necessary steps to bring the password manger back?
I added the files to the Chrome folder and added the css files either to UserChrome.css and UserContent.css as I wasn't sure were to put it. However it still shows site doesn't exist when I open chrome://userchromejs/content/passwordmgr/passwordManager.xhtml
Hey mate, thanks for your great work, however with gresemonkey extension YouTube doesn't work (no video is being played):
Error: Could not establish connection. Receiving end does not exist. background.js:127:2
uncaught exception: g.Ld@https://www.youtube.com/yts/jsbin/player-vflbOM9Vw/en_US/base.js:216:25
rI@https://www.youtube.com/yts/jsbin/player-vflbOM9Vw/en_US/base.js:2431:64
NM@https://www.youtube.com/yts/jsbin/player-vflbOM9Vw/en_US/base.js:2717:119
w_@https://www.youtube.com/yts/jsbin/player-vflbOM9Vw/en_US/base.js:4285:89
@https://www.youtube.com/yts/jsbin/player-vflbOM9Vw/en_US/base.js:7687:161
ytplayer.load@https://www.youtube.com/watch?v=PmZjaYdS3fA&gl=US:191:56537
@https://www.youtube.com/watch?v=PmZjaYdS3fA&gl=US:191:56698
@https://www.youtube.com/watch?v=PmZjaYdS3fA&gl=US:191:56630
Error: Permission denied to access object spf.js:39:25
TypeError: window.spf is undefined base.js:893:92
ReferenceError: spf is not defined watch:1453:1
Error: Could not establish connection. Receiving end does not exist. background.js:127:2
uncaught exception: g.Ld@https://www.youtube.com/yts/jsbin/player-vflbOM9Vw/en_US/base.js:216:25
rI@https://www.youtube.com/yts/jsbin/player-vflbOM9Vw/en_US/base.js:2431:64
NM@https://www.youtube.com/yts/jsbin/player-vflbOM9Vw/en_US/base.js:2717:119
w_@https://www.youtube.com/yts/jsbin/player-vflbOM9Vw/en_US/base.js:4285:89
@https://www.youtube.com/yts/jsbin/player-vflbOM9Vw/en_US/base.js:7687:161
ytplayer.load@https://www.youtube.com/watch?v=PmZjaYdS3fA&gl=US:191:55815
@https://www.youtube.com/watch?v=PmZjaYdS3fA&gl=US:191:55976
@https://www.youtube.com/watch?v=PmZjaYdS3fA&gl=US:191:55908
Error: Permission denied to access object spf.js:39:25
xb< https://www.youtube.com/yts/jsbin/spf-vflhSOzLf/spf.js:39:25
https://www.youtube.com/yts/jsbin/spf-vflhSOzLf/spf.js:39:8
https://www.youtube.com/yts/jsbin/spf-vflhSOzLf/spf.js:1:2
TypeError: window.spf is undefined base.js:893:92
uk.prototype.enable https://www.youtube.com/yts/jsbin/www-en_US-vfl3Mzk7b/base.js:893:92
g.Yh https://www.youtube.com/yts/jsbin/www-en_US-vfl3Mzk7b/base.js:446:1
https://www.youtube.com/yts/jsbin/www-en_US-vfl3Mzk7b/base.js:902:1
https://www.youtube.com/yts/jsbin/www-en_US-vfl3Mzk7b/base.js:1:17
ReferenceError: spf is not defined watch:1453:1
https://www.youtube.com/watch:1453:1
Error: Could not establish connection. Receiving end does not exist.
background.js:127:2
Content Security Policy: The page’s settings blocked the loading of a resource at self (“script-src”). Source: {
.... jinjaccalgkegednnccohejagnlnfdag:1
Content Security Policy: The page’s settings blocked the loading of a resource at self (“script-src”). Source: Da.... jinjaccalgkegednnccohejagnlnfdag:1
Content Security Policy: The page’s settings blocked the loading of a resource at self (“script-src”). Source:
.... jinjaccalgkegednnccohejagnlnfdag:1
TypeError: document.head is null inject.js:70:1
Error: Could not establish connection. Receiving end does not exist. background.js:127:2
Error: Could not establish connection. Receiving end does not exist.
background.js:127:2
CSI/start m=consumer:128:127
CSI/start m=consumer line 472 > eval:1:127
Error: Permission denied to access object
Content Security Policy: The page’s settings blocked the loading of a resource at self (“script-src”). Source: (f.... jinjaccalgkegednnccohejagnlnfdag:1
Error: Permission denied to access object
Any ideas how to get it working? I guess its breaking some CSP rules..
Legacy Greasemonkey is great for some special scripts tho
Hi, just wanted to start by saying thanks for all the work on maintiaining this great resource.
I got things setup on my machine (FF v78, MacOS 10.15) and just wanted to save a little time for others who run MacOS and want to do the same but have trouble due to the FF application folder structure is a little different:
The two files found in the "fx-folder.zip" folder (config.js and config-prefs.js) should go in the following directories:
*Note: both of the sub-directories in number 2. (defaults and pref) should already exist. but if for some reason they don't, simply create them
Tab Focus is an old extension that works well on Waterfox Current 2020.04.
It gives focus at the Tab on which there is the mouse pointer.
It can also be installed in Firefox Developer thanks to your scripts. Unfortunately the extension doesn't work on Firefox. I'm confident that only few adaptions are needed to make it working again.
https://www.mediafire.com/file/jga4nwhq8s566v1/tab_focus-2.0.3-fx.xpi
Is it possible using xul files?
If yes, I don't know where storing them
@xiaoxiaoflood
Hi, looks like that in last Nightly invoking eval(script.startup);
in loadScript()
made crash browser. Script without @startup
directive works correct. Can you confirm? Yesterday all works fine, today I got Nightly update and all stop working. They change something around eval()
funciton?
Since the update to firefox 69 this method has stopped working. Is it possible to modify it somehow to make it work again?
i noticed that only the files located in root of chrome will load,can make it support sub folders?
I'm trying to make a pref page for an bootstrap extension but <checkbox> elements just won't display at all, so does the label of the buttons.
What I'm missing here?
As it seems you have figured out how to make the dorando-keyconfig working in latest thunderbird versions. Would you consider to submit a pull-request to: https://github.com/trlkly/dorando-keyconfig/pulls ?
Hi, can implement this feature for rebuild_userChrome.js ? or is there any alternative ?
regards
Note: user.js from GreaseMonkey
after installing ublock, bootstrap,restart the browser,then cannt open any link which is never visited, there r errors in console
源映射错误:TypeError: NetworkError when attempting to fetch resource.
源 URL:resource://activity-stream/data/content/activity-stream.bundle.js
源映射 URL:activity-stream.bundle.js.map
I tried to install keyconfig.xpi, but I get a message that it's corrupt.
Result: "This addon could not be installed, because it appears to be corrupt."
TL;DR: How can I edit the script to use my own gestures?
I recently installed FF DE and found about this project that allows (among other things) the use of mouse gestures that aren't limited by what web extensions can do, however, the default gestures aren't exactly what I was looking for.
Inside of the script, there's a URL (https://www.cnblogs.com/ziyunfei/archive/2011/12/15/2289504.html) that seems to be a script generator but, it's not working (I tried it with whatever the latest releases of FF DE, Vivaldi, and Waterfox Classic are; as well as FF 40 and even went back as far as 3).
I also tried editing the script itself in Notepad ++ (with 0 knowledge of JS) but whatever I edited stopped working, like this in line 157:
'L>M': {
name: 'Duplicate tab',
cmd: function () {
gBrowser.selectedTab = gBrowser.duplicateTab(gBrowser.selectedTab);
}
},
That I changed to this:
'L>M': {
name: 'Add tab',
cmd: function () {
gBrowser.addTab("http://www.google.com/");
}
},
It didn't work, that gesture stopped working but the rest of them were fine.
I also tried other scripts, like gomita's from xuldev, but they wouldn't load at all.
I want to develop a button that creates a new page and inserts code into it. From javascript it is something simple:
var win = window.open('','','');
var doc = win.document;
doc.open();
doc.write("hello world!");
doc.close();
doc.title = 'speedDial';
but if I use CustomizableUI.createWidget, I don't know how to access the new window element:
var tab = gBrowser.addTab("about:blank", {triggeringPrincipal: Services.scriptSecurityManager.createNullPrincipal({})});
tab.linkedBrowser.contentWindow // this is null
Do you know how to access it?
Thank you
Hi,
I'm running flawlessly your masterPasswordPlus.uc.js script / Firefox 79.0. Brilliant.
In the case you'd have spare time, wondering "what could I possibly do today?" (lol) I'd bring to your attention what may be appreciated by several of us : a cousin script to masterPasswordPlus.uc.js
More seriously, the idea is that of a script which would bring a toolbar button with the only purpose of toggling the activation of the Master Password.
masterPasswordPlus.uc.js handles the activation/deactivation of the Master Password, the code is there to apply it to my suggestion.
The pertinence of a Master Password toggle script? The ability to carry on a browser session with the Master Password deactivated. I may wish to run Firefox without the Master Password (i.e. friends, relatives around), activate/deactivate it accordingly. At this time, lock is performed via your script with Ctrl+Alt+Shift+W (but that blocks as well the use of the browser given it's the very purpose of the script), or with Firefox's Clear All History (ctrl+shift+del) > Active Logins checked . I think a toggle would be pertinent that would allow to carry on a session with the Master password locked and unlock it with a click on a toolbar button (as available on Password Managers' extensions such as Bitwarden).
Even more seriously, I'm sure you have no time to spare, even less to lose. This is a plain suggestion, an idea, not even a concept!
Thanks for your scripts, all of 'em, and the very userChromeJS protocol installer which allows them all.
Hi,
Thanks for sharing your work.
I am asked for a password minutes after the browser opens & am already browsing. Also the input field can just be closed.
Firefox 74 64-bit
Windows 7 Ultimate
https://i.imgur.com/JgfVxGo.png
Thanks again.
Hi @xiaoxiaoflood,
I'm still using your hideTitlebar.uc.js script together with Tree Style Tab addon. It is super-convinient when I need to toggle a tab-bar - no need to use .css or restart a browser. However I have one issue. When the tab-bar is hidden, windows control buttons are still present. What worse, they are active despite being covered by other buttons. So e.g. you can accidentality close the browser when you just want to open the sidebar. Is there any way to get rid off them permanently or at least to deactivate them?
Hi,
masterPasswordPlus.uc.js includes this line:
style: 'position: fixed; display: none; width: 100%; height: 100%; top: 0; background-color: #2C50D1; z-index: 2147483647; cursor: pointer;'
I'm referring to this line because it seems to me it's there or nowhere else that I could add a background-image. Problem is I tried to but unsuccessfully.
background-color of course is easy, but i'd like to add a background-image because a simple little password input in the middle of a 23"" screen is aesthetically odd!
Thanks! Your userChromeJS scripts are fantastic.
I am not sure what location to put these files in on Manjaro Linux (KDE Plasma).
Everything seems to be located at /home/myusername/.mozilla/firefox/myprofile/
Your instructions state to place the config.js and config-prefs.js in the firefox installation folder (with the latter being placed within \defaults\prefs). However, aside from the path mentioned above, I am having trouble finding anything else that looks like it could be my firefox installation folder.
I also tried looking for channel-prefs.js to get a frame of reference as to my installation folder location, but could not find that either.
Please help. Thank you!
Followed the instructions but no UserScript (uc.js) manager appears.
In SaveFileTo, when you go to the Page Info and the Media tab and pick an image file, the Save As button doubles into a "Save As Save As" button. The positioning is a bit weird and the drop menu button also just brings up the Save Dialog window instead of the SaveFileTo list.
Hi there again
As of today's release (ff64) greasemonkey died :((
1544536957329 addons.manager ERROR Exception calling provider .getAddonByID: ReferenceError: service is not defined(chrome://greasemonkey-modules/content/util/getService.js:6:3) JS Stack trace: [email protected]:6:3
[email protected]:79:17
[email protected]:41:12
[email protected]:226:12
asyncgetAddonByID/promises<@AddonManager.jsm:2163:12
[email protected]:2162:20
[email protected]:3280:12
@service.js:114:17
async@service.js:113:2
@getService.js:3:1
[email protected]:59:3
[email protected]:219:7
[email protected]:182:9
[email protected]:41:5
[email protected]:257:11
1544536957331 addons.manager ERROR Exception calling provider .getAddonByID: ReferenceError: service is not defined(chrome://greasemonkey-modules/content/util/getService.js:6:3) JS Stack trace: [email protected]:6:3
[email protected]:79:17
[email protected]:41:12
[email protected]:226:12
asyncgetAddonByID/promises<@AddonManager.jsm:2163:12
[email protected]:2162:20
[email protected]:3280:12
Config.prototype._updateVersion/<@config.js:310:19
async[email protected]:309:4
[email protected]:29:3
@service.js:30:5
[email protected]:36:7
[email protected]:48:14
@service.js:120:1
@getService.js:3:1
[email protected]:59:3
[email protected]:219:7
[email protected]:182:9
[email protected]:41:5
[email protected]:257:11
Can you get it back to life? It's usage on CSP enabled sites is crucial for me :(
Another question is that in Nightly ff65 all listed here addons are non functional..
I guess bootstrapped extensions as they were are dead, will need to convert to webextension experiments.
In case you will take a look at it, check out CB converted to webextension experiment, maintained by Infocatcher:
https://anonfile.com/Y5v7qandb4/custom_buttons-0.0.7.0.0.1-fx_xpi
According to console, this is the error:
NotFoundError: Node.insertBefore: Child to insert before is not a child of this node rebuild_userChrome.uc.js:277:70 onBuild file:///home/spud/.mozilla/firefox/zz9xfriy.dev-edition-default/chrome/rebuild_userChrome.uc.js?1595178026000:277 aEventName resource:///modules/CustomizableUI.jsm:2869 buildWidget resource:///modules/CustomizableUI.jsm:1691 getWidgetNode resource:///modules/CustomizableUI.jsm:1166 buildArea resource:///modules/CustomizableUI.jsm:976 registerToolbarNode resource:///modules/CustomizableUI.jsm:890 registerToolbarNode resource:///modules/CustomizableUI.jsm:3606 onDOMContentLoaded chrome://browser/content/browser.js:1792 onDOMContentLoaded self-hosted:935
EDIT: I have a new error code I just discovered. Here it is: TypeError: can't access property "hidden", doc.getElementById(...) is null
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.