[Ext] userChrome.js

Announce and Discuss the Latest Theme and Extension Releases.
Locked
Lost User 255607
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Re: Add History to Findbar useage

Post by Lost User 255607 »

Leedsfan wrote:If I do a find on a page I can see no way of recalling the history.

push ↑↓ cursor key in the textbox.
Is there supposed to be a dropdown box as in the search bar?

append the following code to userChrome.css.

Code: Select all

#FindToolbar .autocomplete-history-dropmarker {
display: -moz-box !important;
-moz-binding: url("chrome://global/content/bindings/autocomplete.xml#history-dropmarker") !important;
}
Leedsfan
Posts: 110
Joined: December 18th, 2004, 4:26 pm
Location: New Zealand

Re: Add History to Findbar useage

Post by Leedsfan »

Alice0775 wrote:
Leedsfan wrote:If I do a find on a page I can see no way of recalling the history.

push ↑↓ cursor key in the textbox.
Is there supposed to be a dropdown box as in the search bar?

append the following code to userChrome.css.

Code: Select all

#FindToolbar .autocomplete-history-dropmarker {
display: -moz-box !important;
-moz-binding: url("chrome://global/content/bindings/autocomplete.xml#history-dropmarker") !important;
}


Thanks, there is a drop arrow on the Findbar now but it does not work to show a history of previous searches entered in the find bar.
Lost User 255607
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Re: Add History to Findbar useage

Post by Lost User 255607 »

Leedsfan wrote:but it does not work to show a history of previous searches entered in the find bar.


1. It is not saved in the history unless 1.5 seconds(written in the script) pass after the input.

2. It may work on
Windows XP and Firefox2.0.0.3 and 2.0.0.4pre only.
Leedsfan
Posts: 110
Joined: December 18th, 2004, 4:26 pm
Location: New Zealand

Re: Add History to Findbar useage

Post by Leedsfan »

Alice0775 wrote:
Leedsfan wrote:but it does not work to show a history of previous searches entered in the find bar.


1. It is not saved in the history unless 1.5 seconds(written in the script) pass after the input.

2. It may work on
Windows XP and Firefox2.0.0.3 and 2.0.0.4pre only.


I'm using XP and Firefox 2.0.0.3.
I might try it in a new profile and see if any of my extensions are causing a problem. I also have the FindBar repositioned to the top of the screen with this code in userchrome.js

/* The following makes the FIND toolbar appear at the top of the screen instead of the bottom */
var tabbrowser = document.getElementById('appcontent');
var findbar = document.getElementById('FindToolbar');
var browser = document.getElementById("content");
tabbrowser.insertBefore(findbar, browser);

and always visible - using this in Userchrome.css
/* The line below keeps the "Find" toolbar visible all the time */

#FindToolbar[hidden="true"] {
display: -moz-box !important;
}

Could this be causing a problem?
Lost User 255607
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Re: Add History to Findbar useage

Post by Lost User 255607 »

Leedsfan wrote:I'm using XP and Firefox 2.0.0.3.
I might try it in a new profile and see if any of my extensions are causing a problem. I also have the FindBar repositioned to the top of the screen with this code in userchrome.js

/* The following makes the FIND toolbar appear at the top of the screen instead of the bottom */
var tabbrowser = document.getElementById('appcontent');
var findbar = document.getElementById('FindToolbar');
var browser = document.getElementById("content");
tabbrowser.insertBefore(findbar, browser);

and always visible - using this in Userchrome.css
/* The line below keeps the "Find" toolbar visible all the time */

#FindToolbar[hidden="true"] {
display: -moz-box !important;
}

Could this be causing a problem?


OK,
It was recognized that it was a problem of order of execution of the script.

Please test it again after changing a file name in ZZZ-addHistoryFindbar.uc.js from addHistoryFindbar.uc.js.
Leedsfan
Posts: 110
Joined: December 18th, 2004, 4:26 pm
Location: New Zealand

Re: Add History to Findbar useage

Post by Leedsfan »

Alice0775 wrote:
Leedsfan wrote:I'm using XP and Firefox 2.0.0.3.
I might try it in a new profile and see if any of my extensions are causing a problem. I also have the FindBar repositioned to the top of the screen with this code in userchrome.js

/* The following makes the FIND toolbar appear at the top of the screen instead of the bottom */
var tabbrowser = document.getElementById('appcontent');
var findbar = document.getElementById('FindToolbar');
var browser = document.getElementById("content");
tabbrowser.insertBefore(findbar, browser);

and always visible - using this in Userchrome.css
/* The line below keeps the "Find" toolbar visible all the time */

#FindToolbar[hidden="true"] {
display: -moz-box !important;
}

Could this be causing a problem?


OK,
It was recognized that it was a problem of order of execution of the script.

Please test it again after changing a file name in ZZZ-addHistoryFindbar.uc.js from addHistoryFindbar.uc.js.


Thanks for your help with this but I'm afraid the "changing a file name" line above makes no sense to me. Can you be more precise please?.
Lost User 255607
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Re: Add History to Findbar useage

Post by Lost User 255607 »

Leedsfan wrote:I also have the FindBar repositioned to the top of the screen with this code in userchrome.js

If you do not use Sub Script Loader, This script (addHistoryFindbar.uc.js) should be written after other scripts in userChrome.js.
Leedsfan
Posts: 110
Joined: December 18th, 2004, 4:26 pm
Location: New Zealand

Re: Add History to Findbar useage

Post by Leedsfan »

Alice0775 wrote:
Leedsfan wrote:I also have the FindBar repositioned to the top of the screen with this code in userchrome.js

If you do not use Sub Script Loader, This script (addHistoryFindbar.uc.js) should be written after other scripts in userChrome.js.



Thanks, the code is the last in my userchrome.js file but it still won't work. I think I'll give up.
Lost User 255607
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Re: Add History to Findbar useage

Post by Lost User 255607 »

Leedsfan wrote:Thanks, the code is the last in my userchrome.js file but it still won't work. I think I'll give up.

Please confirm setting of Fx.
Toools - Options - Privacy - History - Remember what I enter in forms and the search bar should be checked.
Leedsfan
Posts: 110
Joined: December 18th, 2004, 4:26 pm
Location: New Zealand

Re: Add History to Findbar useage

Post by Leedsfan »

Alice0775 wrote:
Leedsfan wrote:Thanks, the code is the last in my userchrome.js file but it still won't work. I think I'll give up.

Please confirm setting of Fx.
Toools - Options - Privacy - History - Remember what I enter in forms and the search bar should be checked.


All fixed :) I had not ticked that!
old zeniko
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by old zeniko »

I've finally uploaded userChrome.js 0.8 which mostly corresponds to the version I've proposed for inclusion into Firefox itself (in bug 332529).

The main difference to version 0.7 is that userChrome.js is now - similar to userChrome.css - applied to all windows and not just the main browser/messenger window. This allows to more conveniently make changes to other windows, especially without the need for the inconvenient WindowHook snippet.

Before you update, please add the following line of code to the top of your current userChrome.js:

Code: Select all

if (location != "chrome://browser/content/browser.xul") throw "stop";
This will stop script execution at that point for all non-browser windows. Alternatively you can temporarily rename userChrome.js and let the updated extension create a new one which already contains that line.

To replace WindowHook, you can now replace

Code: Select all

WindowHook.register(url, function_to_call);
with placing the following line above the <kbd>throw "stop";</kbd> line from above

Code: Select all

if (location == url) function_to_call(window);


Apart from these modifications, all your snippets should continue to work just fine.
User avatar
dougeeebear
Posts: 548
Joined: September 15th, 2005, 4:17 pm

Post by dougeeebear »

According to install.rdf, version 0.8 isn't compatible with Firefox 1.5 ???

Code: Select all

            <minVersion>2.0</minVersion>
            <maxVersion>3.0+</maxVersion>

What if I change the 2.0 to 1.5.0.* ???
old zeniko
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by old zeniko »

dougeeebear wrote:According to install.rdf, version 0.8 isn't compatible with Firefox 1.5 ???

My bad, I've corrected it to a minVersion of 1.5.0.7 (where bug 345991 was fixed). OTOH Firefox 1.5 is no longer officially supported anyway... ;)
User avatar
Diorser
Posts: 1009
Joined: June 22nd, 2005, 6:57 am

Post by Diorser »

I try to find a workaround of Bug 266600 open in 2004, which does not seem to be a priority for linux/KDE.
Open containing Folder has no effect from the download manager on KDE environment , and and Fx DL manager is really poor.

A proposal has been made to patch browser.js to replace default DLM by Kget of Kde: kget4mozilla-0.2.sh
However, it does not work so well anymore with Fx2.0, but it has worked very well.

I have investigated following draft: <a href="data:text/javascript;charset=utf-8,%0D%0A%0D%0Afunction%20saveURL(aURL%2C%20aFileName%2C%20aFilePickerTitleKey%2C%20aShouldBypassCache)%0D%0A%7B%0D%0A%20%20%2F%2F%20Check%20the%20preferences%20to%20know%20if%20the%20user%20wanted%20to%20use%20a%20download%20manager%0D%0A%20%20%2F%2F%20Move%20this%20back%20to%20the%20contextMenu%0D%0A%20%20var%20useDownloadManager%20%3D%20false%3B%0D%0A%20%20if%20(pref)%20%7B%0D%0A%20%20%20%20try%20%7B%0D%0A%20%20%20%20%20%20useDownloadManager%20%3D%20(pref.getIntPref(%22browser.downloadmanager.behavior%22)%20%3D%3D%200)%3B%0D%0A%20%20%20%20%7D%20catch(ex)%20%7B%0D%0A%20%20%20%20%7D%0D%0A%20%20%7D%0D%0A%0D%0A%20%20if%20(useDownloadManager)%20%7B%0D%0A%20%20%20%20if%20(queryDownloadManager%20(aURL))%0D%0A%20%20%20%20%20%20return%3B%0D%0A%20%20%7D%0D%0A%0D%0A%0D%0Afunction%20saveURL(aURL%2C%20aFileName%2C%20aFilePickerTitleKey%2C%20aShouldBypassCache%2C%20aSkipPrompt)%0D%0A%7B%0D%0A%20%20if%20(queryDownloadManager%20(aURL))%0D%0A%20%20%20%20%20%20return%3B%0D%0A%0D%0A%0D%0A%0D%0Afunction%20queryDownloadManager(url)%0D%0A%7B%0D%0A%09var%20command%20%3D%20%22%2Fbin%2Fbash%22%3B%0D%0A%09var%20args%20%3D%20new%20Array()%3B%0D%0A%09args.push%20(%22-c%22)%3B%0D%0A%09args.push%20(%22kget%20%5C%22%22%20%2B%20url%20%2B%20%22%5C%22%22)%3B%0D%0A%0D%0A%09try%20%7B%0D%0A%09%09var%20applicFile%20%3D%20Components.classes%5B%22%40mozilla.org%2Ffile%2Flocal%3B1%22%5D.createInstance(Components.interfaces.nsILocalFile)%3B%0D%0A%09%09var%20applic%20%3D%20Components.classes%5B%22%40mozilla.org%2Fprocess%2Futil%3B1%22%5D.createInstance(Components.interfaces.nsIProcess)%3B%0D%0A%09%09applicFile.initWithPath(command)%3B%0D%0A%09%09if%20(!%20applicFile.exists())%20%7B%0D%0A%09%09%09return%20false%3B%0D%0A%09%09%7D%20else%20%7B%0D%0A%09%09%09applic.init(applicFile)%3B%0D%0A%09%09%09applic.run(false%2C%20args%2C%20args.length)%3B%0D%0A%09%09%7D%0D%0A%09%7D%20catch%20(e)%20%7B%0D%0A%09%09return%20false%3B%0D%0A%09%7D%0D%0A%09return%20true%3B%0D%0A%7D%0D%0A%0D%0A%0D%0Afunction%20toOpenWindowByType(inType%2C%20uri%2C%20features)%0D%0A%7B%0D%0A%20%20if%20(uri%20%3D%3D%20'chrome%3A%2F%2Fmozapps%2Fcontent%2Fdownloads%2Fdownloads.xul')%20%7B%0D%0A%20%20%20%20%2F%2F%20Try%20to%20open%20the%20KDE%20Download%20Manager%20(KGet)%20and%20if%20it%20fails%20open%20the%20Firefox%20internal%20download%20manager%0D%0A%20%20%20%20if%20(openKDEDownloadManager())%0D%0A%20%20%20%20%20%20return%3B%0D%0A%20%20%7D%20%0D%0A%0D%0A%0D%0Afunction%20openKDEDownloadManager()%0D%0A%7B%0D%0A%09var%20command%20%3D%20%22%2Fbin%2Fbash%22%3B%0D%0A%09var%20args%20%3D%20new%20Array()%3B%0D%0A%09args.push%20(%22-c%22)%3B%0D%0A%09args.push%20(%22kget%20%26%26%20dcop%20kget%20'kget%20mainwindow'%20restore%22)%3B%0D%0A%0D%0A%09try%20%7B%0D%0A%09%09var%20applicFile%20%3D%20Components.classes%5B%22%40mozilla.org%2Ffile%2Flocal%3B1%22%5D.createInstance(Components.interfaces.nsILocalFile)%3B%0D%0A%09%09var%20applic%20%3D%20Components.classes%5B%22%40mozilla.org%2Fprocess%2Futil%3B1%22%5D.createInstance(Components.interfaces.nsIProcess)%3B%0D%0A%09%09applicFile.initWithPath(command)%3B%0D%0A%09%09if%20(!%20applicFile.exists())%20%7B%0D%0A%09%09%09return%20false%3B%0D%0A%09%09%7D%20else%20%7B%0D%0A%09%09%09applic.init(applicFile)%3B%0D%0A%09%09%09applic.run(false%2C%20args%2C%20args.length)%3B%0D%0A%09%09%7D%0D%0A%09%7D%20catch%20(e)%20%7B%0D%0A%09%09return%20false%3B%0D%0A%09%7D%0D%0A%09return%20true%3B%0D%0A%7D%0D%0A%0D%0A">Kget.js</a> , but does not work as expected.
note: Kget manager is at /usr/bin/kget

If somebody has some idea, he would be very welcome !
Sobotnik
Posts: 3
Joined: March 29th, 2007, 1:59 pm

Post by Sobotnik »

Hi,

to deactivate some Items in sanitize dialog, try <a href="data:application/x-javascript;charset=utf-8;base64,V2luZG93SG9vay5yZWdpc3RlcigiY2hyb21lOi8vYnJvd3Nlci9jb250ZW50L3Nhbml0aXplLnh1bCIsIGZ1b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aXZhY3kuaXRlbS5mb3JtZGF0YSIpWzBdLmRpc2FibGVkID0gdHJ1ZTsNCiAgICBkb2N1bWVudC5nZXRFbGVtZW50c0J5QXR0cmlidXRlKCJwcmVmZXJlbmNlIiwgInByaXZhY3kuaXRlbS5jb29raWVzIilbMF0uZGlzYWJsZWQgPSB0cnVlOw0KICB9DQp9KTsNCg0K">sanitize.uc.js</a>.

First part of this script is for CTRL+SHIFT+DEL, the second part handles dialog in preferences.
Locked