MozillaZine

Block File System Browsing

User Help for Mozilla Firefox
dickvl

User avatar
 
Posts: 51376
Joined: July 18th, 2005, 3:25 am

Post Posted July 20th, 2009, 11:08 am

That particular function (BrowserLoadURL) is removed from browser.jar , so it is no longer possible the modify the BrowserLoadURL function to get that block. I had checked that at the first time of the new post (July 15) and couldn't find it, not code in other functions that looked similar. I didn't check other jar files (e.g. toolkit) to see if the code has been moved there.

trolly
Moderator

User avatar
 
Posts: 38953
Joined: August 22nd, 2005, 7:25 am

Post Posted July 20th, 2009, 11:35 am

Explains a lot.
If the first poster had said that we could have saved a lot of time.
Think for yourself. Otherwise you have to believe what other people tell you.
A society based on individualism is an oxymoron. || Freedom is at first the freedom to starve.
Constitution says: One man, one vote. Supreme court says: One dollar, one vote.

young_einstein
Guest
 

Post Posted July 21st, 2009, 2:32 am

trolly wrote:Is the browser.js file no more in browser.jar?


The browser.js file is still there ... but the code inside it is now completely different.

I'm not a big coder [by any stretch of the imagination], but I really can't see anything at all that even remotely resembles the code we were modifying in earlier versions of the program.

I obviously need someone a lot more skilled than me to take a look at it, and see if they can work it out ...

*hint* to all you smart people out there! :)

young_einstein
Guest
 

Post Posted July 21st, 2009, 2:37 am

dickvl wrote:I didn't check other jar files (e.g. toolkit) to see if the code has been moved there.


I've searched every file under C:\Program Files\Mozilla Firefox\* [yes ... including all the compressed .jar files] and none of them have any reference to the old 'BrowserLoadURL' function.

Obviously it's possible that it's just been given a different name, but I haven't had any luck trying to track it down, so I'm really not sure ...

young_einstein
Guest
 

Post Posted July 21st, 2009, 3:01 am

If it's any help to anyone, I've found another page mentioning the removal of the 'BrowserLoadURL' function, and how they worked around it to fix a different feature which was relying on it.

http://www.x2b4.com/howto/how-to-open-e ... firefox-3/

Update 2009/03/01: For Firefox 3.1, the BrowserLoadUrl doesn’t exist anymore. There is new way to have correct behaviour:

(function() {
urlbar = document.getElementById("urlbar");
eval("urlbar.handleCommand = " + urlbar.handleCommand.toString().replace("&& aTriggeringEvent.altKey","&& !aTriggeringEvent.altKey"));
})();


That doesn't really mean a whole lot to me [not being much of a coder and all] ... but hopefully someone might see something in there which sparks a bit of an idea for them.

Here's hoping anyway ... :D

trolly
Moderator

User avatar
 
Posts: 38953
Joined: August 22nd, 2005, 7:25 am

Post Posted July 21st, 2009, 3:14 am

The script is replacing the default handler. A similar function has to be called during startup. I think it can be done from an addon.
Think for yourself. Otherwise you have to believe what other people tell you.
A society based on individualism is an oxymoron. || Freedom is at first the freedom to starve.
Constitution says: One man, one vote. Supreme court says: One dollar, one vote.

aceuk
Guest
 

Post Posted August 8th, 2009, 5:12 pm

Has anyone had any luck with this? This is the only thing preventing me from deploying Firefox where I work. :(

David Tomic
Guest
 

Post Posted August 22nd, 2009, 8:58 pm

Bumpity bump bump ...

Still hoping that someone's going to come up with an answer / solution for this problem?

v360pc
Guest
 

Post Posted August 31st, 2009, 1:26 pm

ok, I finally figured this out. =)

in the browser.jar there is a file named urlbarBindings.jar.Find the section with the tag "<method name="handleCommand">"

Under the following section (~line 64):

Code: Select all
          var [url, postData] = this._canonizeURL(aTriggeringEvent);
          if (!url)
            return;


Just add:

Code: Select all
       if (url.match(/^file:/) || url.match(/^\//) || url.match(/^resource:/) || url.match(/^about:/)) {
            alert("Access denied.");
            exit
          }


Repack the jar, copy it in place and restart your browser.

dickvl

User avatar
 
Posts: 51376
Joined: July 18th, 2005, 3:25 am

Post Posted August 31st, 2009, 8:22 pm

(that should be: browser.jar/content/browser/urlbarBindings.xml)

v360pc
Guest
 

Post Posted September 1st, 2009, 8:42 am

dickvl wrote:(that should be: browser.jar/content/browser/urlbarBindings.xml)
yes. good point. thank you for correcting.

aceuk
Guest
 

Post Posted September 13th, 2009, 9:01 am

Thanks for the tip, v360pc. However, I still can't get it working with Firefox v3.5.3. What am I doing wrong?

Code: Select all
          var [url, postData] = this._canonizeURL(aTriggeringEvent);
         
          if (!url)
            return;

          if (url.match(/^file:/) || url.match(/^\//) || url.match(/^resource:/) || url.match(/^about:/)) {
               alert("Access denied.");
               exit
           }
         
          this.value = url;
          gBrowser.userTypedValue = url;
          try {
            addToUrlbarHistory(url);
          } catch (ex) {
            // Things may go wrong when adding url to session history,
            // but don't let that interfere with the loading of the url.
            Cu.reportError(ex);
          }

aceuk
Guest
 

Post Posted October 3rd, 2009, 7:18 pm

Bump.

aceuk
Guest
 

Post Posted October 17th, 2009, 2:35 pm

Found another way of doing it. All you have to do is put the following into your userContent.css file. :D

Code: Select all
@-moz-document url-prefix(file://) {
 html > body { visibility: hidden !important;
}

hendry
 
Posts: 6
Joined: June 18th, 2003, 6:28 am

Post Posted October 28th, 2009, 6:31 am

None of these solutions seem to work in 3.5.3 :(

http://webconverger.org/kiosk/

Return to Firefox Support


Who is online

Users browsing this forum: Google [Bot] and 30 guests