ScreenOS Firewalls (NOT SRX)
Showing results for 
Search instead for 
Do you mean 
Reply
Visitor
Posts: 4
Registered: ‎05-05-2012

Fix ScreenOS web interface in Google Chrome

[ Edited ]

The ScreenOS webui doesn't work in Google Chrome because it relies on document.all, an IE only feature. There is a workaround for Mozilla already in the code, but that workaround doesn't fix it for Chrome.

 

I wrote a userscript to get it working for the SSG5, simply save it as fix_netscreen_webui.user.js, then add @include headers for the netscreens you administer to the top of the file. Here is an example:

 

// @include http://192.168.1.1/*

// @include https://192.168.1.1/*

// @include http://192.168.2.1/*

// @include https://192.168.2.1/*

// @include http://firewall/*

// @include https://firewall/*

 

And so on (remember to include one for http and one for https if you use both).

 

Then open chrome://extensions in Google Chrome drag the script (it has to be called fix_netscreen_webui.user.js, or something else ending with .user.js) file onto the page. Hopefully it should just magically work.

 

If something goes wrong or you want to remove it, just go to chrome://extensions and click "Remove".

 

You can download it here.

 

Hope this helps.

 

Contributor
Posts: 20
Registered: ‎03-30-2012
0

Re: Fix ScreenOS web interface in Google Chrome

Hello,

Which features do not work? I use Chrome almost exclusively. I am using the most up to date Chrome version (18.0.1025.168)

The Dynamic HTML Menu does not work but the Java menu works fine. Is it an ScreenOS version specific issue? I am running 6.0 on some and 6.3 on others.

Ideas?

Brent

 

Super Contributor
Posts: 144
Registered: ‎02-08-2008
0

Re: Fix ScreenOS web interface in Google Chrome

Yep, simply hit 'Toggle Menu' to switch to the java menu which works fine in all browsers I've tried (including Linux and Android browsers).

Visitor
Posts: 4
Registered: ‎05-05-2012
0

Re: Fix ScreenOS web interface in Google Chrome

Yes, this is intended for people who do not  want to or can't use java applets, sorry if that wasn't clear.

 

It's not a good idea to enable java applets.

Super Contributor
Posts: 144
Registered: ‎02-08-2008
0

Re: Fix ScreenOS web interface in Google Chrome


taviso wrote:

It's not a good idea to enable java applets.


Do you think it's a worse idea than enabling javascript?

Contributor
Posts: 196
Registered: ‎09-21-2010
0

Re: Fix ScreenOS web interface in Google Chrome

Hmm...

 

That'd be an interesting file for the 6000+ ScreenOS devices I support.....

Contributor
Posts: 20
Registered: ‎03-30-2012
0

Re: Fix ScreenOS web interface in Google Chrome

 

WOW!  6000+ Screen0S devices? What is the environment if you don't mind saying. What system are you using to manage them?

Visitor
Posts: 3
Registered: ‎07-01-2010
0

Re: Fix ScreenOS web interface in Google Chrome

[ Edited ]

For some reason, the code in the download link in the original post is missing a function name and has some syntactical problems. I've corrected that and modified the include directives slightly to run on all screenos WebUIs and only on the side menu (afaik that's the only area that fails) to reduce script runtime. Feel free to copy to a text file and name it anything.user.js and install in your browser or you can download the attached file and chop off the .txt extension. Works fine for me and there's no need to have it run on every page or add units individually--which I couldn't do because we're a provider so there are hundreds.

 

EDIT: Forgot to mention, thanks for the original script. It's a huge time saver =]

 

 

// ==UserScript==
// @name          Netscreen Compatability for Google Chrome
// @author        Tavis Ormandy
// @namespace     https://lock.cmpxchg8b.com/
// @description   Fix incompatible javascript conventions used in ScreenOS.
// @include       http://*/dhtml.html*
// @include       https://*/dhtml.html*
// @include       http://*/code.html*
// @include       https://*/code.html*
// ==/UserScript==

// The ScreenOS webui assumes document.all["name"] is equivalent to
// getElementsByTagName("name"), this works on IE and Mozilla, but Chrome does
// not support it, and never will:
//
//  http://www.chromium.org/Home/chromecompatfaq
//
// I can workaround it by manually setting the name property for each element.

function whatever() {
    var elem = document.createElement("script");
    var text = document.createTextNode("()()");

    function install_chrome_workaround () {
        try {
            MTMUA.__defineSetter__("document", function (o) {
                this.__document = o;
                this.__document.__defineGetter__("all", function () {
                    var n = new Array();
                    var e = this.getElementsByTagName("*");
                        for (var i = 0; i < e.length; i++) {
                            if (e[i].hasOwnProperty("name")) {
                                n[e[i].name] = e[i];
                            }
                    }
                    return n;
                });
            });
            MTMUA.__defineGetter__("document", function () {
                return this.__document;
            });
        } catch (e) {};
    }

    elem.setAttribute("type", "text/javascript");
    text.insertData(1, install_chrome_workaround);
    elem.appendChild(text);

    if (document.body) {
        document.body.appendChild(elem);
    }
}
whatever();
Visitor
Posts: 4
Registered: ‎05-05-2012
0

Re: Fix ScreenOS web interface in Google Chrome

[ Edited ]

You're welcome, but it's not a typo or syntactical error, it's a language feature called anonymous functions.

 

But I don't mind you modifying it if you want to customise it :-)

Visitor
Posts: 3
Registered: ‎07-01-2010
0

Re: Fix ScreenOS web interface in Google Chrome

Doh! What a miss. =D

 

Thanks again!

Highlighted
Contributor
Posts: 196
Registered: ‎09-21-2010
0

Re: Fix ScreenOS web interface in Google Chrome

The environment is a national retail chain with lots of locations. 

 

We don't use anything to manage them ;(

 

Moving to SRX I'm trying to push for Space if they can work out a few issues for us.

New User
Posts: 2
Registered: ‎07-22-2009
0

Re: Fix ScreenOS web interface in Google Chrome

for me, the java menu on chrome for linux is horrible (using iced tea java vm). you click a button and the menu pops up on the other side of the screen... no thanks.

 

thanks to this script, i got it working in chrome. FYI chrome 21+ does not allow you to load this from the file:// link, but you can easily drag and drop the file onto the extensions page and it will ask you to install it.

 

thanks again

Visitor
Posts: 4
Registered: ‎05-05-2012
0

Re: Fix ScreenOS web interface in Google Chrome

Thanks, I updated the instructions to include dragging the script onto extensions. Glad it helped!

New User
Posts: 2
Registered: ‎07-22-2009
0

Re: Fix ScreenOS web interface in Google Chrome

well i am back. updated to chrome 27 a few days ago and my netscreen web UI problems have returned. re-installing the extension does not help. any tips?