Skip to content

Commit

Permalink
Broaden runAt types to facilitate injection from the manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante committed Mar 9, 2023
1 parent 127038f commit b8f88a2
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 18 deletions.
8 changes: 0 additions & 8 deletions global.d.ts

This file was deleted.

4 changes: 2 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ async function injectContentScriptInSpecificTarget(
allFrames,
files: script.css ?? [],
matchAboutBlank: script.matchAboutBlank ?? script.match_about_blank,
runAt: script.runAt ?? script.run_at,
runAt: script.runAt ?? script.run_at as RunAt,
}, options),

executeScript({
Expand All @@ -252,7 +252,7 @@ async function injectContentScriptInSpecificTarget(
allFrames,
files: script.js ?? [],
matchAboutBlank: script.matchAboutBlank ?? script.match_about_blank,
runAt: script.runAt ?? script.run_at,
runAt: script.runAt ?? script.run_at as RunAt,
}, options),
]);

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@
},
"devDependencies": {
"@sindresorhus/tsconfig": "^3.0.1",
"@types/chrome": "^0.0.210",
"@types/chrome": "^0.0.220",
"@types/jest": "^29.4.0",
"jest-chrome": "^0.8.0",
"typescript": "^4.9.4",
"vitest": "^0.28.3",
"typescript": "^4.9.5",
"vitest": "^0.29.2",
"xo": "^0.53.1"
}
}
1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"outDir": "."
},
"files": [
"global.d.ts",
"types.d.ts",
"index.test.ts",
"index.ts"
Expand Down
8 changes: 4 additions & 4 deletions types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface ContentScript {
js?: string[] | ExtensionFileOrCode[];

/**
* Prefer `allFrames`
* @deprecated Prefer `allFrames`
*/
all_frames?: boolean;

Expand All @@ -29,7 +29,7 @@ export interface ContentScript {
allFrames?: boolean;

/**
* Prefer `matchAboutBlank`
* @deprecated Prefer `matchAboutBlank`
*/
match_about_blank?: boolean;

Expand All @@ -40,9 +40,9 @@ export interface ContentScript {
matchAboutBlank?: boolean;

/**
* Prefer `runAt`
* @deprecated Prefer `runAt`
*/
run_at?: RunAt;
run_at?: string;

/**
* The soonest that the JavaScript or CSS will be injected into the tab. Defaults to "document_idle".
Expand Down

0 comments on commit b8f88a2

Please sign in to comment.