SuperDevMode on/off bookmarklets aren't compatible with frames

150 views
Skip to first unread message

Davide Cavestro

unread,
Feb 12, 2014, 11:55:07 AM2/12/14
to google-we...@googlegroups.com
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

Davide Cavestro

unread,
Feb 20, 2014, 6:43:15 AM2/20/14
to google-we...@googlegroups.com
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
Reply all
Reply to author
Forward
0 new messages