Skip to content

Commit 92f5b29

Browse files
committed
Load app script earlier in page context.
1 parent 9537f1d commit 92f5b29

2 files changed

Lines changed: 11 additions & 12 deletions

File tree

src/app/Core/ContentInitializer.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { ScriptLoader } from 'Utils/ScriptLoader'
21
import { ExtensionRuntime } from 'Utils/ExtensionRuntime'
32
import { ExtensionConfig } from 'Utils/ExtensionConfig'
43
import { WorkerRPCEndpoint } from 'Communication/WorkerRPCEndpoint'
@@ -17,16 +16,5 @@ export class ContentInitializer {
1716
}
1817
}
1918
)
20-
21-
/*
22-
Why? you wonder?
23-
Well in order to have access to the window attributes to be able to do things like intercepting XHR requests etc...
24-
You'll need your script to run in the page itself, and not within the content scripts of the extension.
25-
26-
Additional benefits it offers is that we won't have to reload the extension in the browser on every build.
27-
*/
28-
return ScriptLoader.inject(
29-
ExtensionRuntime.assetUrl('roids.js')
30-
)
3119
}
3220
}

src/assets/static/manifest.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@
1414
"storage"
1515
],
1616
"content_scripts": [
17+
{
18+
"js": [
19+
"roids.js"
20+
],
21+
"run_at": "document_start",
22+
"matches": [
23+
"https://hostelworld.com/*",
24+
"https://www.hostelworld.com/*"
25+
],
26+
"world": "MAIN"
27+
},
1728
{
1829
"js": [
1930
"content.js"

0 commit comments

Comments
 (0)