@floegence/flowersec-core 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -100,9 +100,9 @@ const INJECT_STRIP_HEADER_NAMES = new Set(["content-length", "etag", "last-modif
|
|
|
100
100
|
|
|
101
101
|
let runtimeClientId = null;
|
|
102
102
|
|
|
103
|
-
self.addEventListener("install", () => {
|
|
103
|
+
self.addEventListener("install", (event) => {
|
|
104
104
|
// Take over as soon as possible.
|
|
105
|
-
|
|
105
|
+
event.waitUntil(self.skipWaiting());
|
|
106
106
|
});
|
|
107
107
|
|
|
108
108
|
self.addEventListener("activate", (event) => {
|
|
@@ -190,6 +190,10 @@ function injectBootstrap(html) {
|
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
const lower = html.toLowerCase();
|
|
193
|
+
const closeHead = lower.indexOf("</head>");
|
|
194
|
+
if (closeHead >= 0) {
|
|
195
|
+
return html.slice(0, closeHead) + snippet + html.slice(closeHead);
|
|
196
|
+
}
|
|
193
197
|
const idx = lower.indexOf("<head");
|
|
194
198
|
if (idx >= 0) {
|
|
195
199
|
const end = html.indexOf(">", idx);
|