ScreenOS Firewalls (NOT SRX)
ScreenOS Firewalls (NOT SRX)

Fix ScreenOS web interface in Google Chrome

[ Edited ]
05.05.12   |  
‎05-05-2012 06:15 AM

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.

 

13 REPLIES
ScreenOS Firewalls (NOT SRX)

Re: Fix ScreenOS web interface in Google Chrome

05.07.12   |  
‎05-07-2012 04:22 PM

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

 

ScreenOS Firewalls (NOT SRX)

Re: Fix ScreenOS web interface in Google Chrome

05.08.12   |  
‎05-08-2012 03:39 AM

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).

ScreenOS Firewalls (NOT SRX)

Re: Fix ScreenOS web interface in Google Chrome

05.08.12   |  
‎05-08-2012 04:31 AM

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.

ScreenOS Firewalls (NOT SRX)

Re: Fix ScreenOS web interface in Google Chrome

05.08.12   |  
‎05-08-2012 08:25 AM

taviso wrote:

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


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

ScreenOS Firewalls (NOT SRX)

Re: Fix ScreenOS web interface in Google Chrome

05.10.12   |  
‎05-10-2012 10:56 AM

Hmm...

 

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

ScreenOS Firewalls (NOT SRX)

Re: Fix ScreenOS web interface in Google Chrome

05.16.12   |  
‎05-16-2012 02:33 PM

 

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

ScreenOS Firewalls (NOT SRX)

Re: Fix ScreenOS web interface in Google Chrome

[ Edited ]
05.23.12   |  
‎05-23-2012 04:52 PM

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();

Attachments

ScreenOS Firewalls (NOT SRX)

Re: Fix ScreenOS web interface in Google Chrome

[ Edited ]
05.24.12   |  
‎05-24-2012 01:21 AM

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 :-)

ScreenOS Firewalls (NOT SRX)

Re: Fix ScreenOS web interface in Google Chrome

05.24.12   |  
‎05-24-2012 01:30 PM

Doh! What a miss. =D

 

Thanks again!

Highlighted
ScreenOS Firewalls (NOT SRX)

Re: Fix ScreenOS web interface in Google Chrome

05.25.12   |  
‎05-25-2012 11:07 AM

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.

ScreenOS Firewalls (NOT SRX)

Re: Fix ScreenOS web interface in Google Chrome

04.30.13   |  
‎04-30-2013 01:09 AM

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

ScreenOS Firewalls (NOT SRX)

Re: Fix ScreenOS web interface in Google Chrome

05.01.13   |  
‎05-01-2013 08:43 PM

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

ScreenOS Firewalls (NOT SRX)

Re: Fix ScreenOS web interface in Google Chrome

05.30.13   |  
‎05-30-2013 11:48 AM

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?