4

I'm using GWT 2.1 and IE to test the default hello world GWT app.

I compile the default Hello world GWT app and then go to HTML file and open it with IE. I get a red warning message "Your web browser must have JavaScript enabled in order for this application to display correctly." I had to allow the active content to be running in order to see the app screen. things are a bit different if I run the app via \.psf\Home \myFile.htm which is path to my Parallel's "shared directory" .. I wouldn't see such warning. also running in dev mode seems not to raise this warning message.

it seeems IE doesn't like people opening JS-laced web pages from the local drive. Probably a security concern, I would imagine.

there is a detailed article that tackles this issue at http://www.phdcc.com/xpsp2.htm

i tried the method of Mark of the web by adding these two lines at the begining of myfile.html file :

<!-- saved from url=(0014)about:internet --> 
<!-- saved from url=(0016)http://localhost --> 

but when i add these two lines and then compile app and open the html file with IE the web app doesn't show even though the warning message is gone!

The reason probably is that (by default) a GWT app is loaded within an iframe, i.e. as another HTML page (*.cache.html), which doesn't contain the MotW.

i Tried using the "xs" or "xsiframe" linker, i.e. add one of these lines to our *.gwt.xml:

<add-linker name="xs" /> 
<add-linker name="xsiframe" /> 

Those linkers use *.cache.js" files, so the MotW in our host page should be enough. but The "xs" linker prevents us from using DevMode . adding line to xml module file make IE warning message go away and can run app locally with IE.however the line above prevent our app to run in dev mode with IE .

any Idea how we can have the app works both in dev mode and web mode?

i'm not keen on having two xml module files one for dev mode and one for web mode. but would like to know how to do that if i have to?

also interested in any other method to run javascript apps locally with IE.

thanks

othman
  • 4,428
  • 6
  • 34
  • 45

3 Answers3

1

Have you tried enabling Active Content from local files in the advanced tab of the Internet Options?

hugomg
  • 68,213
  • 24
  • 160
  • 246
1

This worked for me:

SO - Activex content in local web page

The take away is:

<!-- saved from url=(0014)about:internet -->

Must be the first line in the file and the file must have

\r\n (CRLF)

line endings.

Community
  • 1
  • 1
User123342234
  • 1,455
  • 14
  • 17
0

you could download and set up xampp and put your files in the htdocs folder. This will give you a local server at your loopback address. This will prevent IE from doing all of its acrobatics concerning locally run js files, as it will think it is accessing a remote website.

Scott M.
  • 7,313
  • 30
  • 39
  • as explained in link article, today many apps are web based and need to run them locally without a web server. our GWT app has no RPC it is only GWT client side. – othman Feb 12 '11 at 14:50
  • you can still use xampp to serve the files. I agree it is a bit of a roundabout way to use the application but it can get rid of those security errors. – Scott M. Feb 12 '11 at 15:18
  • imagine if you ship this app to customers and ask them to install xampp for the app to be able to work locally with IE without warning. this is unacceptable solution . most customers will disagree to use a web app that needs to run from a CD and be obliged to install a whole web server just to have the web app to run locally on IE. – othman Feb 12 '11 at 19:01
  • xampp is portable. you could run it from a CD as well. You can have the user double click the exe (or bat, i dont remember which it is) to start up the servers and it will be running without installation. You can even make a custom bat that does exactly what you need, including opening the web browser to http://localhost/ – Scott M. Feb 12 '11 at 20:44
  • yes but really difficult to convince our boss to use a web server! he always gets upset when i suggest using a web server for our gwt app.he says he really needs to push for a client side application! – othman Feb 12 '11 at 21:35
  • then educate your boss. he can't make good decisions without being informed of all the options and their merits and faults. I know it's easier to say than do. have you tried figuring out why it doesnt display with the comment directives? – Scott M. Feb 13 '11 at 03:26
  • as explained in my post using MOTW comment directives in my gwt html file is not enough as (by default) a GWT app is loaded within an iframe, i.e. as another HTML page (*.cache.html), which doesn't contain the MotW. do you have an Idea how to get across this iframe problem with MOTW? – othman Feb 13 '11 at 06:12
  • is *.cache.html dynamically generated? you might be able to hook in somewhere and add in the directives during generation or something. – Scott M. Feb 13 '11 at 13:03
  • yes *.cache.html is dynamically generated by GWT framework.we have no control over gwt dynamically generated resources as far as i know – othman Feb 14 '11 at 01:19