Closed Aris-t2 closed 5 years ago
@Aris-t2
There already is a "Bookmark Tab" entry in context menu
Thanks, but in FF 64 does not work browser.oldsearch.clearinput
, so i stay on FF 63.
@pro100Hub
You can find a script to clear search bars input and to revert to first engine in list here: https://www.camp-firefox.de/forum/viewtopic.php?f=16&t=112673&start=2010#p1099758
@Aris-t2 I have a humble request Regarding another UndoClosedTab functionality (basically all those extensions out there have some flaws). Recently I've run to this script https://github.com/Endor8/userChrome.js/blob/master/Update 2018/UndoListInTabmenuToo.uc.js
UPD. This one here has a custom toolbar button with menu https://github.com/Endor8/userChrome.js/blob/master/Update 2018/extras_config_menu.uc.js
I'm just wondering is it possible to create a button based on this script that does the following: LeftClick (open Recently closed tabs in a drop-down menu) RightClick (open Recently closed windows in a drop-down menu)
THX in advance
Most likely it is.
Try 'about:home' instead.
No idea why the page is white for you, but for me the same page opens for 'about:newtab' and 'about:home'. 'about:blank' is not used anywhere in the code.
If the add-on does the job for you, why would you use the script then?
i just want it transparency thats all, do you have a solution how to make about:newtab blank transparency? anyway thanks a lot bro.
Method 2 on Linux:
Hi, My paths:
tree -as --dirsfirst /home/username/.mozilla/firefox/22t6vtr5.default/chrome/
/home/username/.mozilla/firefox/22t6vtr5.default/chrome/
├── [ 4096] userChrome
│ ├── [ 183083] alternative_searchbar.uc.js
│ ├── [ 1427] userChromeJS.js
│ └── [ 6490] userChromeJSutilities.js
└── [ 191] userChrome.js
1 directory, 4 files
cat /home/username/.mozilla/firefox/22t6vtr5.default/chrome/userChrome.js
// userChrome.js
userChrome.ignoreCache = true;
userChrome.import("/userChrome/alternative_searchbar.uc.js", "UChrm");
tree -as --dirsfirst /usr/lib64/firefox/
/usr/lib64/firefox/
├── [ 4096] browser
│ ├── [ 4096] chrome
│ │ └── [ 4096] icons
│ │ └── [ 4096] default
│ │ ├── [ 12667] default128.png
│ │ ├── [ 798] default16.png
│ │ ├── [ 2145] default32.png
│ │ ├── [ 3607] default48.png
│ │ └── [ 5168] default64.png
│ ├── [ 4096] defaults
│ │ └── [ 4096] preferences
│ │ └── [ 1820] firefox-redhat-default-prefs.js
│ ├── [ 4096] features
│ │ ├── [ 619610] formautofill@mozilla.org.xpi
│ │ ├── [ 1170884] screenshots@mozilla.org.xpi
│ │ ├── [ 17770] webcompat@mozilla.org.xpi
│ │ └── [ 25260] webcompat-reporter@mozilla.org.xpi
│ ├── [ 184548] blocklist.xml
│ ├── [ 0] chrome.manifest
│ ├── [ 787] crashreporter-override.ini
│ └── [ 40747933] omni.ja
├── [ 4096] defaults
│ └── [ 4096] pref
│ ├── [ 245] channel-prefs.js
│ └── [ 133] config-prefs.js
├── [ 18] dictionaries -> /usr/share/myspell
├── [ 4096] distribution
│ └── [ 159] distribution.ini
├── [ 4096] fonts
│ ├── [ 1057104] TwemojiMozilla.ttf
│ └── [ 36] .uuid
├── [ 4096] gmp-clearkey
│ └── [ 4096] 0.1
│ ├── [ 102304] libclearkey.so
│ └── [ 223] manifest.json
├── [ 4096] gtk2
│ └── [ 25384] libmozgtk.so
├── [ 12288] langpacks
│ ├── [ 465919] langpack-ach@firefox.mozilla.org.xpi
│ ├── [ 441960] langpack-af@firefox.mozilla.org.xpi
│ ├── [ 483356] langpack-an@firefox.mozilla.org.xpi
│ ├── [ 523548] langpack-ar@firefox.mozilla.org.xpi
│ ├── [ 487673] langpack-as@firefox.mozilla.org.xpi
│ ├── [ 471989] langpack-ast@firefox.mozilla.org.xpi
│ ├── [ 500418] langpack-az@firefox.mozilla.org.xpi
│ ├── [ 563356] langpack-be@firefox.mozilla.org.xpi
│ ├── [ 533898] langpack-bg@firefox.mozilla.org.xpi
│ ├── [ 551535] langpack-bn-BD@firefox.mozilla.org.xpi
│ ├── [ 38] langpack-bn@firefox.mozilla.org.xpi -> langpack-bn-IN@firefox.mozilla.org.xpi
│ ├── [ 538815] langpack-bn-IN@firefox.mozilla.org.xpi
│ ├── [ 489651] langpack-br@firefox.mozilla.org.xpi
│ ├── [ 481524] langpack-bs@firefox.mozilla.org.xpi
│ ├── [ 479841] langpack-ca@firefox.mozilla.org.xpi
│ ├── [ 516514] langpack-cak@firefox.mozilla.org.xpi
│ ├── [ 504999] langpack-cs@firefox.mozilla.org.xpi
│ ├── [ 494580] langpack-cy@firefox.mozilla.org.xpi
│ ├── [ 497085] langpack-da@firefox.mozilla.org.xpi
│ ├── [ 505003] langpack-de@firefox.mozilla.org.xpi
│ ├── [ 514745] langpack-dsb@firefox.mozilla.org.xpi
│ ├── [ 568944] langpack-el@firefox.mozilla.org.xpi
│ ├── [ 465123] langpack-en-CA@firefox.mozilla.org.xpi
│ ├── [ 451629] langpack-en-GB@firefox.mozilla.org.xpi
│ ├── [ 435146] langpack-en-ZA@firefox.mozilla.org.xpi
│ ├── [ 492631] langpack-eo@firefox.mozilla.org.xpi
│ ├── [ 501366] langpack-es-AR@firefox.mozilla.org.xpi
│ ├── [ 501097] langpack-es-CL@firefox.mozilla.org.xpi
│ ├── [ 448915] langpack-es-ES@firefox.mozilla.org.xpi
│ ├── [ 38] langpack-es@firefox.mozilla.org.xpi -> langpack-es-AR@firefox.mozilla.org.xpi
│ ├── [ 503967] langpack-es-MX@firefox.mozilla.org.xpi
│ ├── [ 483850] langpack-et@firefox.mozilla.org.xpi
│ ├── [ 487501] langpack-eu@firefox.mozilla.org.xpi
│ ├── [ 540178] langpack-fa@firefox.mozilla.org.xpi
│ ├── [ 480665] langpack-ff@firefox.mozilla.org.xpi
│ ├── [ 480820] langpack-fi@firefox.mozilla.org.xpi
│ ├── [ 510189] langpack-fr@firefox.mozilla.org.xpi
│ ├── [ 38] langpack-fy@firefox.mozilla.org.xpi -> langpack-fy-NL@firefox.mozilla.org.xpi
│ ├── [ 499241] langpack-fy-NL@firefox.mozilla.org.xpi
│ ├── [ 38] langpack-ga@firefox.mozilla.org.xpi -> langpack-ga-IE@firefox.mozilla.org.xpi
│ ├── [ 485379] langpack-ga-IE@firefox.mozilla.org.xpi
│ ├── [ 501591] langpack-gd@firefox.mozilla.org.xpi
│ ├── [ 477283] langpack-gl@firefox.mozilla.org.xpi
│ ├── [ 507652] langpack-gn@firefox.mozilla.org.xpi
│ ├── [ 38] langpack-gu@firefox.mozilla.org.xpi -> langpack-gu-IN@firefox.mozilla.org.xpi
│ ├── [ 568953] langpack-gu-IN@firefox.mozilla.org.xpi
│ ├── [ 495384] langpack-he@firefox.mozilla.org.xpi
│ ├── [ 38] langpack-hi@firefox.mozilla.org.xpi -> langpack-hi-IN@firefox.mozilla.org.xpi
│ ├── [ 553932] langpack-hi-IN@firefox.mozilla.org.xpi
│ ├── [ 474782] langpack-hr@firefox.mozilla.org.xpi
│ ├── [ 514458] langpack-hsb@firefox.mozilla.org.xpi
│ ├── [ 511759] langpack-hu@firefox.mozilla.org.xpi
│ ├── [ 531308] langpack-hy-AM@firefox.mozilla.org.xpi
│ ├── [ 38] langpack-hy@firefox.mozilla.org.xpi -> langpack-hy-AM@firefox.mozilla.org.xpi
│ ├── [ 488898] langpack-ia@firefox.mozilla.org.xpi
│ ├── [ 481806] langpack-id@firefox.mozilla.org.xpi
│ ├── [ 480194] langpack-is@firefox.mozilla.org.xpi
│ ├── [ 366370] langpack-it@firefox.mozilla.org.xpi
│ ├── [ 517059] langpack-ja@firefox.mozilla.org.xpi
│ ├── [ 504029] langpack-kab@firefox.mozilla.org.xpi
│ ├── [ 530061] langpack-ka@firefox.mozilla.org.xpi
│ ├── [ 560516] langpack-kk@firefox.mozilla.org.xpi
│ ├── [ 544258] langpack-km@firefox.mozilla.org.xpi
│ ├── [ 547268] langpack-kn@firefox.mozilla.org.xpi
│ ├── [ 511527] langpack-ko@firefox.mozilla.org.xpi
│ ├── [ 486639] langpack-lij@firefox.mozilla.org.xpi
│ ├── [ 514812] langpack-lt@firefox.mozilla.org.xpi
│ ├── [ 500925] langpack-lv@firefox.mozilla.org.xpi
│ ├── [ 505637] langpack-mai@firefox.mozilla.org.xpi
│ ├── [ 467809] langpack-mk@firefox.mozilla.org.xpi
│ ├── [ 550899] langpack-ml@firefox.mozilla.org.xpi
│ ├── [ 549060] langpack-mr@firefox.mozilla.org.xpi
│ ├── [ 484173] langpack-ms@firefox.mozilla.org.xpi
│ ├── [ 527248] langpack-my@firefox.mozilla.org.xpi
│ ├── [ 38] langpack-nb@firefox.mozilla.org.xpi -> langpack-nb-NO@firefox.mozilla.org.xpi
│ ├── [ 484308] langpack-nb-NO@firefox.mozilla.org.xpi
│ ├── [ 515717] langpack-ne-NP@firefox.mozilla.org.xpi
│ ├── [ 475557] langpack-nl@firefox.mozilla.org.xpi
│ ├── [ 38] langpack-nn@firefox.mozilla.org.xpi -> langpack-nn-NO@firefox.mozilla.org.xpi
│ ├── [ 482953] langpack-nn-NO@firefox.mozilla.org.xpi
│ ├── [ 497053] langpack-oc@firefox.mozilla.org.xpi
│ ├── [ 495052] langpack-or@firefox.mozilla.org.xpi
│ ├── [ 38] langpack-pa@firefox.mozilla.org.xpi -> langpack-pa-IN@firefox.mozilla.org.xpi
│ ├── [ 515950] langpack-pa-IN@firefox.mozilla.org.xpi
│ ├── [ 394114] langpack-pl@firefox.mozilla.org.xpi
│ ├── [ 486637] langpack-pt-BR@firefox.mozilla.org.xpi
│ ├── [ 38] langpack-pt@firefox.mozilla.org.xpi -> langpack-pt-PT@firefox.mozilla.org.xpi
│ ├── [ 499543] langpack-pt-PT@firefox.mozilla.org.xpi
│ ├── [ 488832] langpack-rm@firefox.mozilla.org.xpi
│ ├── [ 490378] langpack-ro@firefox.mozilla.org.xpi
│ ├── [ 556604] langpack-ru@firefox.mozilla.org.xpi
│ ├── [ 499066] langpack-si@firefox.mozilla.org.xpi
│ ├── [ 514327] langpack-sk@firefox.mozilla.org.xpi
│ ├── [ 495074] langpack-sl@firefox.mozilla.org.xpi
│ ├── [ 459136] langpack-son@firefox.mozilla.org.xpi
│ ├── [ 502786] langpack-sq@firefox.mozilla.org.xpi
│ ├── [ 516332] langpack-sr@firefox.mozilla.org.xpi
│ ├── [ 38] langpack-sv@firefox.mozilla.org.xpi -> langpack-sv-SE@firefox.mozilla.org.xpi
│ ├── [ 495003] langpack-sv-SE@firefox.mozilla.org.xpi
│ ├── [ 539771] langpack-ta@firefox.mozilla.org.xpi
│ ├── [ 556728] langpack-te@firefox.mozilla.org.xpi
│ ├── [ 518295] langpack-th@firefox.mozilla.org.xpi
│ ├── [ 505068] langpack-tr@firefox.mozilla.org.xpi
│ ├── [ 531292] langpack-uk@firefox.mozilla.org.xpi
│ ├── [ 532096] langpack-ur@firefox.mozilla.org.xpi
│ ├── [ 476909] langpack-uz@firefox.mozilla.org.xpi
│ ├── [ 498638] langpack-vi@firefox.mozilla.org.xpi
│ ├── [ 473019] langpack-xh@firefox.mozilla.org.xpi
│ ├── [ 518841] langpack-zh-CN@firefox.mozilla.org.xpi
│ ├── [ 38] langpack-zh@firefox.mozilla.org.xpi -> langpack-zh-TW@firefox.mozilla.org.xpi
│ └── [ 521893] langpack-zh-TW@firefox.mozilla.org.xpi
├── [ 579] application.ini
├── [ 0] chrome.manifest
├── [ 379] config.js
├── [ 449560] crashreporter
├── [ 4003] crashreporter.ini
├── [ 89] dependentlibs.list
├── [ 337664] firefox
├── [ 337672] firefox-bin
├── [ 54416] liblgpllibs.so
├── [ 2032688] libmozavcodec.so
├── [ 265328] libmozavutil.so
├── [ 15720] libmozgtk.so
├── [ 232304] libmozsandbox.so
├── [ 1006376] libmozsqlite3.so
├── [ 21680] libmozwayland.so
├── [ 112922232] libxul.so
├── [ 389] LICENSE
├── [ 1592920] minidump-analyzer
├── [ 17086816] omni.ja
├── [ 337272] pingsender
├── [ 46] platform.ini
├── [ 325168] plugin-container
├── [ 8786] run-mozilla.sh
└── [ 825] Throbber-small.gif
16 directories, 157 files
And my searchbar still don't work like old searchbar and looks like this:
I just want to use 'Alternative Searchbar' script https://github.com/Aris-t2/CustomJSforFx/issues/11 What am I doing wrong? firefox-64.0-4.fc29.x86_64
Install Firefox 60 ESR or Firefox 63?
I had Firefox 63, but I wanted to have the latest version (security fixes, etc.). Did you manage to run the "Alternative Searchbar" on Firefox 64?
@knedel:
cat /home/username/.mozilla/firefox/22t6vtr5.default/chrome/userChrome.js // userChrome.js userChrome.ignoreCache = true; userChrome.import("/userChrome/alternative_searchbar.uc.js", "UChrm");
What happens, if you remove the starting slash in userChrome.import
? Now it’s an absolute path I think, but you need it to be relative. @Aris-t2 if so userChrome.js must be fixed.
I tried:
userChrome.import("userChrome/alternative_searchbar.uc.js", "UChrm");
userChrome.import("./userChrome/alternative_searchbar.uc.js", "UChrm");
userChrome.import("/home/username/.mozilla/firefox/22t6vtr5.default/chrome/userChrome/alternative_searchbar.uc.js", "UChrm");
but the above three variants didn't help.
This is the minimal configuration. Don't remove the // ....
line or the file won't be loaded.
However, I can only test method 1 on Linux and macOS, because I don't have the patience to go through the admin/rights/permissions nonsense for system/program folders I want to change.
So I use "method 1" there and it works fine for me. Just tested on Ubuntu.
@Aris-t2 , please show me the output of the commands on your Ubuntu:
cat ./chrome/userChrome.css
cat ./chrome/userChrome/userChrome.xml
tree -as --dirsfirst ./chrome
I'm starting to be confused.
I don't see how this might help you. I really just used the files from here and added the used script names to the xml. I hope you have not forgotten to clear the cache after every change: https://github.com/Aris-t2/CustomJSforFx#scriptstartup-cache-must-be-deleted-after-every-change
dummyuser@dummyuser:~/.mozilla/firefox/6uegelun.default$ cat ./chrome/userChrome.css
toolbarbutton#alltabs-button { -moz-binding: url("./userChrome/userChrome.xml#execute_javascript_code"); } dummyuser@dummyuser:~/.mozilla/firefox/6uegelun.default$ cat ./chrome/userChrome/userChrome.xml <?xml version="1.0"?>
<bindings id="generalBindings" xmlns="http://www.mozilla.org/xbl" xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:xbl="http://www.mozilla.org/xbl">
dummyuser@dummyuser:~/.mozilla/firefox/6uegelun.default$ tree -as --dirsfirst ./chrome
Command 'tree' not found, but can be installed with:
sudo snap install tree # version 3.5, or sudo apt install tree
See 'snap info tree' for additional versions.
Maybe I'm crazy, but I can't run the Alternative Searchbar script. I tried both Method 1 and Method 2 on Fedora Linux 29 and Windows 10 (fresh Firefox 64 install). I think the instructions you posted are too poor or you have not written about a plugin, patch or something like this. Yes, I cleaned the contents of the startupCache directory. Still, thanks for your willingness to help. I still need to set up this add-on at https://addons.mozilla.org/en-US/firefox/addon/classical-search-bar
Method 1 on my Fedora:
tree -as --dirsfirst ./chrome
./chrome
├── [ 4096] userChrome
│ ├── [ 183083] alternative_searchbar.uc.js
│ └── [ 786] userChrome.xml
└── [ 106] userChrome.css
1 directory, 3 files
cat ./chrome/userChrome/userChrome.xml
<?xml version="1.0"?>
<bindings id="generalBindings"
xmlns="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xbl="http://www.mozilla.org/xbl">
<binding id="execute_javascript_code" extends="chrome://global/content/bindings/toolbarbutton.xml#menu">
<implementation>
<constructor>
<![CDATA[
function load_js_script(js_file_name) {
Services.scriptloader.loadSubScript(Components.stack.filename.substring(0,
Components.stack.filename.lastIndexOf("/") + 1) + js_file_name, window);
}
load_js_script("alternative_searchbar.uc.js");
// load other scripts
// load_js_script("my_other_script_name.uc.js");
]]>
</constructor>
</implementation>
</binding>
</bindings>
By the way - why you can't install tree package on your Ubuntu?
try edit values in alternative_searchbar.uc.js
:
// Configuration area - start
var clear_searchbar_after_search = true; // clear input after search (true) or not (false)
var revert_to_first_engine_after_search = true; // revert to first engine (true) or not (false)
var old_search_engine_selection_popup_fx64 = true; // show old search engine selection popup (true) or not (false)
var select_engine_by_scrolling_over_button = false; // select search engine by scrolling mouse wheel over search bars button (true) or not (false)
var hide_oneoff_search_engines = true; // hide 'one off' search engines (true) or not (false)
var hide_addengines_plus_indicator = false; // hide add engines '+' sign (true) or not (false)
var hide_placeholder = false; // hide placeholder (true) or not (false)
var show_search_engine_names = false; // show search engine names (true) or not (false)
var show_search_engine_names_with_scrollbar = false; // show search engine names with scrollbars (true) or not (false)
var show_search_engine_names_with_scrollbar_height = '170px'; // higher values show more search engines
var searchsettingslabel = "Search settings";
var hide_popup_when_selecting_engine_with_hotkeys = true; // hide popup when using 'CTRL or MOUSE WHEEL + UP&DOWN keys' to switch engine (true) or not (false)
Cześć Krystian, czy mógłbyś mi pomóc po polsku? Niekoniecznie tutaj, może na skype czat by tu nie zaśmiecać, albo na maila? Hi Krystian, could you help me in Polish? Not necessarily here, maybe chat on skype would not clutter here or email?
I do not know if I will help with this Fedora, only so I noticed that in my case the default values in the file alternative_searchbar.uc.js
do not change the appearance of the retractable search list (and rather it is not a javascript cache error).
I gave up, I still have it:
@knedel
I think the instructions you posted are too poor or you have not written about a plugin, patch or something like this.
I'm sorry, if the instructions are not clear enough for you, but there is nothing I can do to improve your situation. Hundreds of other users don't have the issue and the scripts work fine for them. I've tested scripts in Firefox 60-66 on different Windows systems and Linux and it worked everywhere.
By the way - why you can't install tree package on your Ubuntu? Because I don't need it. I'm using Linux in a VM for testing code inside Mozilla applications, nothing more. Neither Linux nor macOS are part of my main systems.
@krystian3w Editing values won't help, if the scripts can not be loaded
@knedel
I just created a new VM (KUbuntu this time). I pasted method 1 files into profiles chrome
folder, added alternative_searchbar.uc.js
and restart_button.uc.js
scripts to method 1s userChrome
folder and added both file names to userChrome.xml
file.
Started Firefox and both scripts were enabled. No idea why this does not work for you, but just to be sure, backup your profile folder and start with a new clean one.
Fedora ≈ Red Hat ≠ Ubuntu.
I know that Fedora is a derivative of Redhat, and Ubuntu - Debian. I checked the newly created other user account - it does not work either. Is the restart_button.uc.js script necessary for the alternative_searchbar.uc.js script to work?
Is the restart_button.uc.js script necessary for the alternative_searchbar.uc.js script to work?
Nope.
No idea why some Linux variations allow custom scripts and other don't. However when I saw it right, knedel even has this issue on Windows 10. Unfortunately I can't offer any other kind of support for this, sorry.
Nevertheless, thank you for your willingness to help me.
You tried remove files from startupCache
your Firefox profile?
Yes, after each change in files:
Despite this Alternative Search Bar doesn't work. I added Restart Button script, but it doesn't work too. I've no idea why.
Maybe no property added files from method 1? https://github.com/Aris-t2/CustomJSforFx/issues/2
Because it is seen in a screenshot I provided in Aris-t2/CustomCSSforFx, issue #163 I thought of adding the script here. In fact, I have very short script code from 2 sources in Camp Firefox (German forum) merged into one script file I named ToggleFindbarMenubar.uc.js
, but I will present them here separated.
/* ToggleFindbar - aborix in
* https://www.camp-firefox.de/forum/viewtopic.php?p=1091349#p1091349
*/
(function() {
if (location == 'chrome://browser/content/browser.xul') {
document.getElementById('cmd_find').setAttribute('oncommand',
'if (!gFindBar || gFindBar.hidden) { gLazyFindCommand("onFindCommand") } else { gFindBar.close() }'
);
};
})();
/* ToggleMenubar - edits by Speravir
*/
(function() {
if (location != 'chrome://browser/content/browser.xul')
return;
/* Original: EffPeh in
https://www.camp-firefox.de/forum/viewtopic.php?p=1060179#p1060179 */ let map = {}; onkeydown = onkeyup = function(e){ e = e || event; map[e.keyCode] = e.type == 'keydown';
/* Keycodes edited, for more see in
* https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode#Value_of_keyCode
*/
// map[16] = shift; map[17] = ctrl; map[18] = alt; map[173] = ASCII hyphen-minus
if( map[16] == true && map[17] == true && map[173] == true ) {
e.preventDefault();
e.stopPropagation();
let node = document.getElementById('toolbar-menubar');
let isVisible = node.getAttribute('autohide');
if( isVisible == 'false' ) {
node.setAttribute('autohide', 'true');
} else {
node.setAttribute('autohide', 'false');
}
map = {};
}
} / End of original ToggleMenubar / })();
Hello Aris,
I'm using 21 userChrome.js scripts in FX but 1 don't work anymore (from 2 or 3 versions). This is : https://github.com/ardiman/userChrome.js/blob/master/backtothefavicon/BackToTheFavicon.uc.js (It replace the "i" in adressbar with the favicon of the visited site). Can anyboby try this script if it work ? Anybody have a solution to correct the script ? I really miss this function ! Thanks in advance for your answer. Have a nice weekend !
Hi @Aris-t2. Is it possible to replace AppButton (#PanelUI-button .toolbarbutton-icon) icon with profile avatar (#appMenu-fxa-avatar) when Firefox sync is enabled?
Hi all, Is anyone else having problems with the movable_urlbar.uc.js & movable_menu_button scripts?
The menubutton script no longer works for me whatsoever and also removes it from my browser unless I open a new window.
The urlbar script works, but it reverts back to its original place in the nav-bar regardless where I put it.
Any and all help is sincerely appreciated. Thanks in advance, ya'll!
@niceboy76 Any chance the script by ardiman got already updated?
@Acid-Crash Replacing the icon should be possible, but I don't how, because I never used any sync stuff.
@tortious Those scripts don't work anymore. Firefox overrides positions on startup. The only way to still achieve this is forcing a predefined toolbar position for those items like done in this example: https://github.com/Aris-t2/CustomJSforFx/issues/1
Hi @Aris-t2 Recently I have noticed that BrowserToolbox > Style Editor shows multiple entries of Styles that seem to be coming from JS. I do understand that they need to be there, however it is not clear why some of them are shown multiple times (typically it's from appMenu-restart-button JS).
Do you have any insights on this matter? I'm on Win10x64, Release FF and Method 2 for JS
Try move turned/used scripts to other localization as \chrome\userChrome
? Example: move to \chrome\userChrome\scripts
.
For me this is remove duplicated CSS.
@Acid-Crash My guess they are present multiple times, because they get registered for every window you open.
because they get registered for every window you open.
Many opened tabs (no windows) no create dupilicates?
@krystian3w Hi right now I have the following structure: chrome/userChrome.js chrome/userChrome/separate scripts. @Aris-t2, indeed, made some tests and it seems to be the source. Can this behavior affect browser performance? Maybe it would me better to move CSS from JS to a separate CSS?
I don't think it can affect browser performance.
You can of course move CSS code to userChrome.css and userContent.css respectively, but only, if it does not contain any variables based on the JS code inside script file.
I made two scripts to make the PanelUI and addon overflow buttons movable. This technique currently works in ff66-68, I haven't tested anything in between so let me know if there's any problem. Feel free to include them here if you want.
https://github.com/Patchonn/firefox-theme/blob/master/userChrome/movable_menu_button.uc.js https://github.com/Patchonn/firefox-theme/blob/master/userChrome/movable_overflow_button.uc.js
How about I add links to your project/collection on main page instead? ;-)
Sure, I don't mind. But that's just my personal theme.
Hi @Aris-t2, just wondering could you please make a slim version of alternative_searchbar.uc.js that will only replace glass icon with the icon of a default search engine?
// 'Alternative search bar icon' script for Firefox 60+ by Aris
//
// Feature: search button shows current search engines icon (like with old search)
setTimeout(function(){
try {
var searchbar = document.getElementById("searchbar");
updateStyleSheet();
// setIcon function taken from browsers internal 'searchbar.js' file and added modifications
searchbar.setIcon = function(element, uri) {
element.setAttribute("src", uri);
updateStyleSheet();
};
// main style sheet
function updateStyleSheet() {
var sss = Components.classes["@mozilla.org/content/style-sheet-service;1"].getService(Components.interfaces.nsIStyleSheetService);
var uri = Services.io.newURI("data:text/css;charset=utf-8," + encodeURIComponent(' \
.searchbar-search-button .searchbar-search-icon { \
list-style-image: url('+document.getElementById("searchbar").currentEngine.iconURI.spec+') !important; \
} \
\
'), null, null);
// remove old style sheet
if (sss.sheetRegistered(uri,sss.AGENT_SHEET)) {
sss.unregisterSheet(uri,sss.AGENT_SHEET);
}
sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET);
};
} catch(e) {}
},1000);
Great, works like a charm. Is this section deals with the multiple style sheet load that we were discussing earlier?
// remove old style sheet
if (sss.sheetRegistered(uri,sss.AGENT_SHEET)) {
sss.unregisterSheet(uri,sss.AGENT_SHEET);
}
sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET);
It is the general way to apply custom stylesheets within JS files.
It removes the old one with the old icon, if you switch search engines, instead of just overriding the old code. Last line would also work without removing old code.
Hi,
Before Quantum, I was using an extension to get a download window. The small weird unusable thing that appear when clicking the download button and the download tabs not being satisfying for me, I made this code:
var DownloadWindow = null;
(function() {
try {
var download_button = document.getElementById('downloads-button');
download_button.onmousedown =
function() {
if(DownloadWindow == null || DownloadWindow.closed) {
DownloadWindow = window.open("about:downloads","DownloadsWindow","chrome,dialog=no,all,width=640,height=480,centerscreen,scrollbars=yes,resizable=yes,dependent=yes");
}
else {
DownloadWindow.focus();
}
};
}
catch(e) {}
})();
Worked for me on Firefox Quantum 65.0.2 Feel free to use it if you want.
Also, one tip: when you have lots of changes to do in Javascript, you can create a shortcut to Firefox, then in the path to the .exe, add "-purgecaches", so that it clear the caches automatically without having to open their folder and delete them manually every time.
Example of content of target field of shortcut: "C:\Firefox\firefox.exe" -purgecaches
Lets discuss everything related to JavaScript here instead of opening new threads for questions or request.
Custom scripts https://github.com/Aris-t2/CustomJSforFx/tree/master/scripts
Other custom script collections - by ardiman - by Endor8