Take the 2-minute tour ×

It seems that firefox has disabled the ability to run a javascript: from the URL...does anybody know of a way around this?

My site requires an id pulled from the html of another site when that user is logged in. Instead of having the user search the 'view source' page I devised a javascript link to scrape it and send it to the site automagically, but it doesn't work on firefox.

The actual code I'm trying to run:

javascript:void(window.open('http://mysite.com/login?u=' + encodeURIComponent(window.location) + '&s=' + SessionId));

Scrapping the session id from the game in order to pull data for the player, nothing like a facebook hack or anything malicious.

share|improve this question
"run a javascript: from the URL" - What do you mean by that? From what URL? Are you talking about an anchor element with href="javascript:doSomething()"? Or do you mean from the address bar? –  nnnnnn Nov 1 '12 at 4:12
from the navigation bar, such as javascript:void() in the address bar –  Pastor Bones Nov 1 '12 at 4:23

1 Answer 1

I'd have to see your code but you really shouldn't have a problem doing what you're attempting to do. If you need another option though I have one you could try. If the content of the page you're scraping is within the same domain as your other site you could use an iframe to get the ID.

Here's some code to consider:

Your data collecting page:

<!DOCTYPE html>
    <title>Disable Firefox 7.0.1 javascript in url security</title>    
    <script type="text/javascript">
    function scrapeData() {
        var frame = document.getElementById("otherPage");
        var otherPagesObj = frame.contentWindow.document.getElementById("otherContent");
        alert("Your data: " + otherPagesObj.innerHTML);
<body onload="scrapeData();">
    <iframe id="otherPage" src="otherpage.htm" width="1" height="1" />

Your page to be scraped (otherpage.htm):

<!DOCTYPE html>
    <title>Other Page - Disable Firefox 7.0.1 javascript in url security</title>    
    <div id="otherContent">1</div>

Using the above code you can see "1" alerted from the div of another page. This is a simple, cross-browser compatible option for what you're attempting to do.

Hope this helps.

share|improve this answer
IFrame is not possible, updated my question to show actual code involved and a brief explanation of the two sites involved. –  Pastor Bones Nov 1 '12 at 4:31

Your Answer


