Block File System Browsing
- dickvl
- Posts: 54163
- Joined: July 18th, 2005, 3:25 am
Re: Block File System Browsing
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
- Posts: 39851
- Joined: August 22nd, 2005, 7:25 am
Re: Block File System Browsing
Explains a lot.
If the first poster had said that we could have saved a lot of time.
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.
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.
-
- Guest
Re: Block File System Browsing
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!
-
- Guest
Re: Block File System Browsing
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 ...
-
- Guest
Re: Block File System Browsing
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/
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 ...
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 ...
- trolly
- Moderator
- Posts: 39851
- Joined: August 22nd, 2005, 7:25 am
Re: Block File System Browsing
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.
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.
-
- Guest
Re: Block File System Browsing
Has anyone had any luck with this? This is the only thing preventing me from deploying Firefox where I work.
-
- Guest
Re: Block File System Browsing
Bumpity bump bump ...
Still hoping that someone's going to come up with an answer / solution for this problem?
Still hoping that someone's going to come up with an answer / solution for this problem?
-
- Guest
Re: Block File System Browsing
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):
Just add:
Repack the jar, copy it in place and restart your browser.
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
- Posts: 54163
- Joined: July 18th, 2005, 3:25 am
Re: Block File System Browsing
(that should be: browser.jar/content/browser/urlbarBindings.xml)
-
- Guest
Re: Block File System Browsing
yes. good point. thank you for correcting.dickvl wrote:(that should be: browser.jar/content/browser/urlbarBindings.xml)
-
- Guest
Re: Block File System Browsing
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);
}
-
- Guest
Re: Block File System Browsing
Found another way of doing it. All you have to do is put the following into your userContent.css file.
Code: Select all
@-moz-document url-prefix(file://) {
html > body { visibility: hidden !important;
}
-
- Posts: 6
- Joined: June 18th, 2003, 6:28 am
- Contact: