Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SDM (dev_mode_on.js) to work with strong CSP #9952

Merged
merged 6 commits into from
Jun 4, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 10 additions & 7 deletions dev/codeserver/java/com/google/gwt/dev/codeserver/dev_mode_on.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,19 +122,22 @@
result.style.background = '#ddd';
result.style.border = '2px outset #ddd';
result.style.padding = '3pt';
result.setAttribute('href', 'javascript:' + encodeURIComponent(javascript));
result.onclick = javascript;
result.title = 'Tip: drag this button to the bookmark bar';
lgemeinhardt marked this conversation as resolved.
Show resolved Hide resolved
return result;
}

function makeCompileBookmarklet(codeserver_url, module_name) {
var bookmarklets_js = codeserver_url + 'dev_mode_on.js';
var javascript = '{ window.__gwt_bookmarklet_params = {'
+ 'server_url:\'' + codeserver_url + '\','
+ 'module_name:\'' + module_name + '\'};'
+ ' var s = document.createElement(\'script\');'
+ ' s.src = \'' + bookmarklets_js + '\';'
+ ' void(document.getElementsByTagName(\'head\')[0].appendChild(s));}';
var javascript = function() {
window.__gwt_bookmarklet_params = {
server_url: codeserver_url,
module_name: module_name
};
var s = document.createElement('script');
s.src = bookmarklets_js;
void(document.getElementsByTagName('head')[0].appendChild(s));
};
lgemeinhardt marked this conversation as resolved.
Show resolved Hide resolved
return makeBookmarklet('Compile', javascript);
}

Expand Down