[Ext] userChrome.js

Announce and Discuss the Latest Theme and Extension Releases.
Locked
old nicholas.alipaz
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by old nicholas.alipaz »

You could try going chromeless, rather than fullscreen.

Here is the code for <a href="data:text/plain;charset=utf-8;base64,ZnVuY3Rpb24gaGlkZUNocm9tZSgpIHsKaWYgKG5hdmlnYXRvci5wbGF0Zm9ybSA9PSAiV2luMzIiKSB7CndpbmRvdy5tb3ZlVG8oMCwwKTsKd2luZG93Lm1heGltaXplKCk7CmRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJtYWluLXdpbmRvdyIpLnNldEF0dHJpYnV0ZSgnaGlkZWNocm9tZScsJ3RydWUnKTsKLy8gcHJlc2VydmUgc21hbGwgYXJlYSBmb3IgdGFza2JhciB0byBhcHBlYXIKd2luZG93LnJlc2l6ZVRvKHNjcmVlbi5hdmFpbFdpZHRoLCBzY3JlZW4uYXZhaWxIZWlnaHQtMik7Cn0gZWxzZSB7CmRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJtYWluLXdpbmRvdyIpLnNldEF0dHJpYnV0ZSgnaGlkZWNocm9tZScsJ3RydWUnKTsKd2luZG93Lm1vdmVUbygwLDApOwp3aW5kb3cucmVzaXplVG8oc2NyZWVuLmF2YWlsV2lkdGgsIHNjcmVlbi5hdmFpbEhlaWdodCk7CndpbmRvdy5tYXhpbWl6ZSgpOwp9Cn0gCmhpZGVDaHJvbWUoKTs%3D">Chromeless</a>, your browser will start chromeless with 2 pixels at the bottom to allow for focusing the windows taskbar.
Zoolcar9
Posts: 2225
Joined: November 9th, 2004, 6:45 pm
Location: Jakarta, Indonesia (UTC+7)
Contact:

Post by Zoolcar9 »


Zeniko, this thread has reached 50+ pages.
I think you should lock this thread and continue in a new thread.

My Firefox information | Add-ons | GitHub

"With great power, comes great desire to show it off."
old zeniko
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by old zeniko »

Zoolcar9 wrote:I think you should lock this thread and continue in a new thread.

Most information from page 1 is still valid as there haven't been any relevant changes to the extension since its original release. A new thread won't help much in this situation - it would rather have you look through two threads when you search something. What would rather help is a repository for all the snippets à la userscripts.org. Anybody having the time/energy/resources for setting one up...?
User avatar
Aus
Posts: 183
Joined: September 6th, 2004, 1:59 pm

Post by Aus »

It would be really nice if there was a central repository for scripts...
alta88
Posts: 1029
Joined: January 28th, 2006, 3:08 pm

Post by alta88 »

i'm trying to do some tweaks in Tb using eval, and have the following to prevent blank subject notifies in function GenericSendMessage in MsgComposeCommands.js:

Code: Select all

         eval("GenericSendMessage = " + GenericSendMessage.
            toString().replace("if (subject == \"\")",
            "if (subject == \"\") break;"));

but get 'GenericSendMessage in not defined'. so i put it as part of a windowhook registration for the compose window (where other tweaks are working fine) and get the same thing. even tried a settimeout in case the js wasn't getting loaded in time.

any ideas?
User avatar
Ria
Posts: 3550
Joined: March 21st, 2004, 3:25 am
Location: Netherlands

Re: Modification to findbar

Post by Ria »

Alice0775 wrote:To show the found term in the middle of the screen.

It is applied at the following.

1.Find from Findbar.
2.SearchWP Version1.0
3.All-In-One Search button Version1.67

and It is compatible XUL/Migemo [Forked Edition]0.5.0~

This script can be worked with Firefox2.0.0.3, Firefox3.0α4pre, Windows XP.

http://space.geocities.jp/alice0775/STO ... dbar.uc.js

This is really fabulous, Alice!
Bug 171237 – Scroll view a few lines beyond occurrence of found search term with type ahead find to show more context instead of bottom of page
alta88
Posts: 1029
Joined: January 28th, 2006, 3:08 pm

Post by alta88 »

The latest 0.7.5 version of Adblock Plus removed Blockable Items from the Firefox sidebar, this xul snippet will restore it there. Works well with MultiSidebar for flexible positioning of the sidebar. The xul loader script on page 1 (or similar) is required.

<a href="data:text/javascript;charset=utf-8;base64,PD94bWwgdmVyc2lvbj0iMS4wIj8%2BDQo8IS0tUmVzdG9yZSBBZGJsb2NrIFBsdXMgQmxvY2thYmxlIEl0ZW1zIHRvIEZpcmVmb3ggU2lkZWJhciAoQUJQIHYwLjcuNSkgIC0tPg0KPCFET0NUWVBF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JldHVybiAoaXNDaGVja2VkKTsNCn0NCmZ1bmN0aW9uIGRldGFjaFNpZGViYXIoKSB7DQoJaWYgKCFhYnApDQoJCXJldHVybjsNCg0KLy8Jc2F2ZVN0YXRlKCk7DQoNCgkvLyBDYWxjdWxhdGUgZGVmYXVsdCBwb3NpdGlvbiBmb3IgdGhlIGRldGFjaGVkIHdpbmRvdw0KCXZhciBib3hPYmplY3QgPSBkb2N1bWVudC5kb2N1bWVudEVsZW1lbnQuYm94T2JqZWN0Ow0KCXZhciBwb3NpdGlvbiA9ICIsbGVmdD0iK2JveE9iamVjdC5zY3JlZW5YKyIsdG9wPSIrYm94T2JqZWN0LnNjcmVlblkrIixvdXRlcldpZHRoPSIrYm94T2JqZWN0LndpZHRoKyIsb3V0ZXJIZWlnaHQ9Iitib3hPYmplY3QuaGVpZ2h0Ow0KDQoJLy8gQ2xvc2Ugc2lkZWJhciBhbmQgb3BlbiBkZXRhY2hlZCB3aW5kb3cNCglhYnBUb2dnbGVTaWRlYmFyKCk7DQoJYWJwRGV0YWNoZWRTaWRlYmFyID0gd2luZG93Lm9wZW5EaWFsb2coImNocm9tZTovL2FkYmxvY2twbHVzL2NvbnRlbnQvc2lkZWJhckRldGFjaGVkLnh1bCIsICJfYmxhbmsiLCAiY2hyb21lLHJlc2l6YWJsZSxkZXBlbmRlbnQsZGlhbG9nPW5vIitwb3NpdGlvbik7DQoNCgkvLyBTYXZlIHNldHRpbmcNCglhYnBQcmVmcy5kZXRhY2hzaWRlYmFyID0gdHJ1ZTsNCglhYnBQcmVmcy5zYXZlKCk7DQp9DQpdXT48L3NjcmlwdD4NCg0KPC9vdmVybGF5Pg0K">Adblock Plus Blockable Items in Sidebar</a>
User avatar
Aus
Posts: 183
Joined: September 6th, 2004, 1:59 pm

Post by Aus »

May I ask a question of the experts here please :)

I'm not a programmer so forgive the naivety of the question.

Would it be possible, using userchrome.js, to stop Live Bookmarks from updating every time the browser is opened.

Being on dial-up, this 'feature' makes the browser unusable for several minutes.

Thanks for any help.

Aus
Old Greg S
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by Old Greg S »

Is there any script that I could use to open all class of .text-link in a new tab instead of a new window?
alta88
Posts: 1029
Joined: January 28th, 2006, 3:08 pm

Post by alta88 »

A suggestion: probably the most difficult thing about userchrome.js for an average user is the .js or .xul loading script (as we've seen here before). Even the Adblock Plus author noted it was very difficult to figure out. Would it be possible/desirable to have the loader built in? Ideally 2 prefs would indicate which absolute or relative to \chrome (or in chrome by default) folder would be looked at for .js or .xul files to load. Another nicety would be logic to log a bad script file but continue with the next. Perhaps already including windowhook.js. Things to reduce error potential..
old zeniko
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by old zeniko »

alta88 wrote:probably the most difficult thing about userchrome.js for an average user is the .js or .xul loading script

What's so difficult about copying the snippet into userChrome.js and then creating new files ending in .uc.js resp. .uc.xul? Besides, this extension isn't targeted at the average user anyway (which is why it's not available from AMO).

alta88 wrote:Another nicety would be logic to log a bad script file but continue with the next.

If you use the Sub-Script Loader from the first post of this thread, that's what should be happening already. Note that such behavior will however be impossible to achieve for two code snippets located inside the same file.

alta88 wrote:Perhaps already including windowhook.js.

The next version will rather make that snippet plain obsolete. See the first attachment to bug 332529 for a preview of version 0.8.
alta88
Posts: 1029
Joined: January 28th, 2006, 3:08 pm

Post by alta88 »

first, i've got it quite customized and personally don't find it 'so hard'. but apparently even your target (ie readers of this thread) or developers (wladimir won't recommend it) *do*. on reading the bug, it seems you want to make this a Fx standard. well that certainly is contradictory to 'not targeted at the average user', no? plus - why should even a sophisticate (lol) *have* to cut/paste a core function? are you not interested in making this even easier to use...?
old zeniko
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by old zeniko »

alta88 wrote:but apparently even your target (ie readers of this thread) or developers (wladimir won't recommend it) *do*.

This extension mainly targets JavaScript developers. Some readers of this thread aren't -- and neither are most of Adblock Plus' users. Of course, anybody is free to use userChrome.js and the snippets available on the 'net, but as you've noted yourself, this is neither Greasemonkey nor Stylish -- and I don't have neither time nor motivation of turning it into such.

alta88 wrote:it seems you want to make this a Fx standard.

Indeed, in the same way that userChrome.css already is (note: many users prefer Stylish -- for good reason). There's no included sub-style loader for userChrome.css (except for CSS's @include) and per analogy there won't be for userChrome.js thus, either (except for XPCOM's mozIJSSubScriptLoader).
max1million
Posts: 2810
Joined: November 15th, 2004, 5:03 am

Post by max1million »

What it was intended for and what it's used for are not necessarily the same. Many posts here are just asking for a script for something that is not available or cause they only want part of what's in an extension. And they expect it to work just by having this extension installed. But the extension does what it was intended to. That's saying you both have a point.

Is there anything stopping anyone from taking the ideas here, combining them, and making a new extension? Not that I want to. To make it even simpler, why not also include a context menuitem to install the script for them. Or a popup with textbox where they can paste the script in, and a place for name(filename without extension), then click ok to save/install it or click cancel to not (just throwing ideas). Of course not everyone may know why the browser has suddenly stopped working or how to fix it, and just blame the extension and author.

I actually use different extension (my own) for scripts and xul. I just modify the xul file in the extension's folder. I find it easier to add dom elements with xul. The script is placed in a script tag as cdata along with xul. Also have a test.xul in there that loaded from the main overlay.xul. "To each his own"
alta88
Posts: 1029
Joined: January 28th, 2006, 3:08 pm

Post by alta88 »

zeniko wrote:Indeed, in the same way that userChrome.css already is (note: many users prefer Stylish -- for good reason). There's no included sub-style loader for userChrome.css (except for CSS's @include) and per analogy there won't be for userChrome.js thus, either (except for XPCOM's mozIJSSubScriptLoader).


did you even read what you wrote? let me paraphrase: i want to follow the css model, which doesn't have an import function, except that it does [n.b. @import], and therefore there won't be one for userchrome, except that there is a way [just don't expect the utility of a 3 line macro to wrap it up for you, jump through the hoop yourself].

i've created importScript and importXUL functions based on subscript loader, so that it's easy to comment out something in userchrome.js and organize files in a subdir of chrome - sort of ridiculous to have to rename a file to not load it.

i sure didn't suggest you write a stylish or greasemonkey application. amazing how the tiniest improvement idea is met with a closeminded 'why' and kneejerk refusal.

whatever.
Locked