feat: offscreen page

This commit is contained in:
DIYgod
2023-12-08 07:18:04 +00:00
parent 8dfd2bdd2a
commit a715f0d465
7 changed files with 32 additions and 9 deletions
+7 -2
View File
@@ -19,7 +19,7 @@
"devDependencies": {
"@ianvs/prettier-plugin-sort-imports": "4.1.1",
"@iconify/tailwind": "^0.1.4",
"@types/chrome": "0.0.251",
"@types/chrome": "^0.0.254",
"@types/node": "20.9.0",
"@types/react": "18.2.37",
"@types/react-dom": "18.2.15",
@@ -35,7 +35,12 @@
"https://*/*"
],
"permissions": [
"tabs"
"tabs",
"offscreen",
"storage",
"notifications",
"alarms",
"idle"
]
}
}
+4 -4
View File
@@ -29,8 +29,8 @@ devDependencies:
specifier: ^0.1.4
version: 0.1.4
'@types/chrome':
specifier: 0.0.251
version: 0.0.251
specifier: ^0.0.254
version: 0.0.254
'@types/node':
specifier: 20.9.0
version: 20.9.0
@@ -2638,8 +2638,8 @@ packages:
engines: {node: '>=10.13.0'}
dev: false
/@types/chrome@0.0.251:
resolution: {integrity: sha512-UF+yr0LEKWWGsKxQ5A3XOSF5SNoU1ctW3pXcWJPpT8OOUTEspYeaLU8spDKe+6xalXeMTS0TBrX1g0b6qlWmkw==}
/@types/chrome@0.0.254:
resolution: {integrity: sha512-svkOGKwA+6ZZuk9xtrYun8MYpNY/9hD17rgZ19v3KunhsK1ZOKaMESw12/1AXLh1u3UPA8jQIRi2370DXv9wgw==}
dependencies:
'@types/filesystem': 0.0.35
'@types/har-format': 1.2.15
-2
View File
@@ -1,2 +0,0 @@
export {}
console.log("HELLO WORLD FROM BGSCRIPTS")
+8
View File
@@ -0,0 +1,8 @@
export { }
console.log("HELLO WORLD FROM BGSCRIPTS")
chrome.offscreen.createDocument({
url: chrome.runtime.getURL("tabs/offscreen.html"),
reasons: [chrome.offscreen.Reason.IFRAME_SCRIPTING],
justification: 'Get RSS in the sandbox for enhanced security.',
});
@@ -1,7 +1,7 @@
import type { PlasmoCSConfig } from "plasmo"
export const config: PlasmoCSConfig = {
matches: ["https://www.plasmo.com/*"]
matches: ["https://docs.plasmo.com/*"]
}
window.addEventListener("load", () => {
+3
View File
@@ -0,0 +1,3 @@
export { }
console.log("HELLO WORLD FROM SANDBOXES")
+9
View File
@@ -0,0 +1,9 @@
function OffscreenPage() {
console.log("HELLO WORLD FROM OFFSCREEN")
return (
<iframe id="sandbox" src="/sandboxes/index.html"></iframe>
);
}
export default OffscreenPage;