We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 133fde1 commit 399e538Copy full SHA for 399e538
src/content-script.js
@@ -1,8 +1,10 @@
1
(() => {
2
window.__securlyPlusLoad = async loadedData => {
3
data = loadedData;
4
- // load idb
5
- idb = await import(data.idbUrl);
+ // load idb (but sanitize the URL first)
+ const idbUrl = data.idbUrl.match(/^(moz|chrome)-extension:\/\/([\w-]+)\/idb.js$/);
6
+ if (!idbUrl) throw new Error("invalid IDB url");
7
+ idb = await import(`${idbUrl[1]}-extension://${idbUrl[2]}/idb.js`);
8
db = await idb.openDB("__securly-plus-db", 2, {
9
upgrade(db, oldVersion) {
10
if (oldVersion < 1) {
0 commit comments