Skip to content

Commit

Permalink
Always attach rapidContext to the window
Browse files Browse the repository at this point in the history
This helps people writing extensions and tampermonkey scripts that enhance Rapid.
  • Loading branch information
bhousel committed Dec 13, 2024
1 parent 8e6b243 commit 966c591
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
}
];

window.rapidContext = context;
context.initAsync();
}
}
Expand Down
3 changes: 1 addition & 2 deletions scripts/predeploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ shell.sed('-i', /context.buildSHA.*;/, `context.buildSHA = '${buildSHA}';`, file
shell.sed('-i', /context.buildDate.*;/, `context.buildDate = '${yyyymmdd}';`, file);

if (isDebug) {
shell.sed('-i', 'rapid.min.js', `${path}/rapid.js`, file); // don't use minified rapid
shell.sed('-i', 'const context =', 'const context = window.context =', file); // make context global
shell.sed('-i', 'rapid.min.js', `${path}/rapid.js`, file); // don't use minified rapid
} else {
shell.sed('-i', 'rapid.min.js', `${path}/rapid.min.js`, file);
}

0 comments on commit 966c591

Please sign in to comment.