Thursday, February 20, 2014

Re: SuperDevMode on/off bookmarklets aren't compatible with frames

The problem was that I didn't adapted the script portion that saves the __gwt_bookmarklet_params variable (it should work on the frame window).

So since in my case the frame was called 'sheet', at the end for me it was enough adapting it this way
javascript:%7B var sheetFrame %3D document.getElementById('sheet') %3B sheetFrame.contentWindow.__gwt_bookmarklet_params %3D %7B'server_url'%3A'http%3A%2F%2Flocalhost%3A9876%2F'%7D%3B var s %3D sheetFrame.contentWindow.document.createElement('script')%3B s.src %3D 'http%3A%2F%2Flocalhost%3A9876%2Fdev_mode_on.js'%3B void(sheetFrame.contentWindow.document.getElementsByTagName('head')%5B0%5D.appendChild(s))%3B%7D

that is simply the URL encoded version of
javascript:{ var sheetFrame = document.getElementById('sheet') ; sheetFrame.contentWindow.__gwt_bookmarklet_params = {'server_url':'http://localhost:9876/'}; var s = sheetFrame.contentWindow.document.createElement('script'); s.src = 'http://localhost:9876/dev_mode_on.js'; void(sheetFrame.contentWindow.document.getElementsByTagName('head')[0].appendChild(s));}

Cheers
Davide

On Wednesday, February 12, 2014 5:55:07 PM UTC+1, Davide Cavestro wrote:
I have an entry point hosted into an iframe. I have to manually open the host page into a new browser tab in order to make the superdev mode aware of the modules available (otherwise the superdev mode UI doesn't detect any module).
I've tried to manually tweak the bookmarklet code in order to create the boot script element within the frame (instead than within the outer document) but at this point when I run the bookmarklet I obtain a dialog complaining

Need to reinstall the bookmarklets.

I suspect the bookmarklet js code is somewhat validated against some hash, and if I manually edit it the validation fails...
Is there any workaround?
I reproduce this issue with GWT 2.6.0 both on Google Chrome 32.0.1700.107 and Firefox 26.0

Kind regards
Davide

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment