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

Expose window object via WorkerLinker #37

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class AppWorker implements EntryPoint {

@Override
public void onModuleLoad() {
DomGlobal.console.log("Loaded module AppWorker");

WorkerFactory<MyHost, MyWorker> factory = WorkerFactory.of(MyHost_Impl::new);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public ArtifactSet link(TreeLogger logger, LinkerContext context, ArtifactSet ar
String[] javaScript = result.getJavaScript();
out.print("var $wnd = self, $doc, $entry, $workergwtbridge, $moduleName, $moduleBase;");
out.newline();
out.print("window = $wnd;");
// out.print("if(typeof(window) != 'undefined'){ $wnd = window; $doc = $wnd.document; }");
// out.newline();
// out.print("else{ $wnd = {JSON: JSON}; }"); // gwtwwlinker - mind the $wnd.JSON passthrough used by autobeans
Expand Down