From 966c591f378c62ba55c71e54c09f67fd7db89701 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Fri, 13 Dec 2024 08:43:09 -0500 Subject: [PATCH] Always attach rapidContext to the window This helps people writing extensions and tampermonkey scripts that enhance Rapid. --- dist/index.html | 1 + scripts/predeploy.js | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.html b/dist/index.html index 0a8e730dc9..b0ba09c347 100644 --- a/dist/index.html +++ b/dist/index.html @@ -62,6 +62,7 @@ } ]; + window.rapidContext = context; context.initAsync(); } } diff --git a/scripts/predeploy.js b/scripts/predeploy.js index a41d7d3762..e128bb48b3 100644 --- a/scripts/predeploy.js +++ b/scripts/predeploy.js @@ -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); }