kimmie
Contributor
Contributor

Local help not rendered in chrome/chromium, linux host [solved]

...using info from http://stackoverflow.com/questions/5111306/call-a-javascript-function-defined-in-an-iframe-in-chrome...

I just installed vmware workstation on a (gentoo) linux host and it bugged me that chromium refuses to display the local help (instead, I get to see a couple of blank frames with a divider). Turns out this happens because of chromium's security restrictions on file:// URLs. It treats every file:// as coming from a separate domain, so it sees the vmware help as a potential cross-site scripting attack. Firefox behaves the same way.

If you're not worried about the security issues, you can work around this by placing CHROMIUM_USER_FLAGS=--allow-file-access-from-files in your environment. The flag exists for use by web developers when testing. I'm not really sure just how insecure this is.


If you're more paranoid (or just overcome by a sudden fit of extreme geek, like I was), you can restrict the workaround to browsers invoked from vmware:


alias vmware='CHROMIUM_USER_FLAGS="--allow-file-access-from-files
  --proxy-server=127.0.0.1:0 --proxy-bypass-list=vmware.com,*.vmware.com
  ---user-data-dir=$HOME/.config/chromium-vmware" vmware'


If you want that in your desktop menu, use the command:


bash -c 'CHROMIUM_USER_FLAGS="--proxy-server=127.0.0.1:0 --proxy-bypass-list=vmware.com,*.vmware.com
   --allow-file-access-from-files --user-data-dir=$HOME/.config/chromium-vmware"

    exec /opt/vmware/bin/vmware'


The -–user-data-dir forces a separate chrome profile, which will make sure instances of chrome opened from vmware aren't handled by any already-running browser processes. The –-proxy-server is a black hole to prevent these instances accessing the internet; that's just so you don't forget and keep using them after closing vmware. The -–proxy-bypass-list overrides the black hole and allows you to access vmware online help.

It'd be nice if vmware would fix their javascript, though! Yes, that's a hint.

0 Kudos
4 Replies
warriorfullight
Enthusiast
Enthusiast

Thanks for sharing this one. I have read about this matter from the link you posted. I agree that VM have to fix it on their end. I should also tell my friends about it using linux host. Smiley Happyhttp://imagicon.info/cat/5-59/1.gif

0 Kudos
WoodyZ
Immortal
Immortal

FWIW... Gentoo Linux is not a supported Host or Guest OS for VMware Workstation and I have no problems displaying the Workstation Help file on the supported Linux Host OSes I've installed it on and with displaying it in Firefox as well.

0 Kudos
kimmie
Contributor
Contributor

Woodz,

I really don't think it's a gentoo issue per se. The help files are simply extracted from the distribution bundle.

I haven't had problems with help in the past either, but I am now, both with chromium 13 and with firefox 3.6.17. Here's the chromium console output:

Unsafe JavaScript attempt to access frame with URL file:///opt/vmware/lib/vmware/help/workstation/wwhelp/wwhimpl/common/html/content.htm from frame with URL file:///opt/vmware/lib/vmware/help/workstation/wwhelp/wwhimpl/common/html/pagenav.htm. Domains, protocols and ports must match.

Unsafe JavaScript attempt to access frame with URL file:///opt/vmware/lib/vmware/help/workstation/wwhelp/wwhimpl/js/html/wwhelp.htm from frame with URL file:///opt/vmware/lib/vmware/help/workstation/wwhelp/wwhimpl/common/html/pagenav.htm. Domains, protocols and ports must match.

Unsafe JavaScript attempt to access frame with URL file:///opt/vmware/lib/vmware/help/workstation/wwhelp/wwhimpl/common/html/content.htm from frame with URL file:///opt/vmware/lib/vmware/help/workstation/wwhelp/wwhimpl/common/html/init0.htm. Domains, protocols and ports must match.

Unsafe JavaScript attempt to access frame with URL file:///opt/vmware/lib/vmware/help/workstation/wwhelp/wwhimpl/js/html/wwhelp.htm from frame with URL file:///opt/vmware/lib/vmware/help/workstation/wwhelp/wwhimpl/common/html/init0.htm. Domains, protocols and ports must match.

Uncaught TypeError: Cannot read property 'WWHHelp' of null - init0.htm:33

If I take the same help files and serve them from apache, there's no problem.

Perhaps:

  • you were using earlier versions of chrome or firefox, or
  • workstation is somehow invoking chromium with --allow-files-access-from-files on other distributions, or
  • desktop environments on other distributions invoke chromium differently all by themselves

I'm curious to hear from any workstation 7.1.4 / linux host users out there... anybody else seeing this? Or not?

0 Kudos
kimmie
Contributor
Contributor

Well, since I posted this, VMWare have changed their javascript. But not in a good way.

The help index.html now explicitly checks for Chrome, and simply prevents help from loading. So, now it won't work in Chrome, even if you use the --allow-file-access-from-files workaround.

So now, if you want VMWare help to work with Chrome, use my original workarond, and additionally edit the

file /opt/vmware/lib/vmware/help/workstation/index.html to comment out checks.

Regardless of whether you think it's Chrome or the VMWare help that's the problem, this sort of change is completely unhelpful, all it does is further annoy users. Chrome has something like 20% market share now; this means means about 1 in 5 users of VMWare workstation help will get annoyed. Way to go.

:smileyangry:

0 Kudos