-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: side_panel manifest property (#121)
* feat: support side panel * add test
- Loading branch information
Showing
5 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html | ||
|
||
exports[`sidePanelHtml - Manifest V3 1`] = ` | ||
[ | ||
{ | ||
"code": "function log(message) { | ||
console.log(message); | ||
} | ||
log(\\"sidepanel\\"); | ||
", | ||
"dynamicImports": [], | ||
"exports": [], | ||
"facadeModuleId": "vite-plugin-web-extension/test/manifest/resources/sidePanelHtml/sidepanel.html", | ||
"fileName": "assets/test/manifest/resources/sidePanelHtml/sidepanel.js", | ||
"implicitlyLoadedBefore": [], | ||
"importedBindings": {}, | ||
"imports": [], | ||
"isDynamicEntry": false, | ||
"isEntry": true, | ||
"isImplicitEntry": false, | ||
"map": null, | ||
"modules": { | ||
"vite-plugin-web-extension/test/manifest/resources/shared/log.js": { | ||
"code": "function log(message) { | ||
console.log(message); | ||
}", | ||
"originalLength": 65, | ||
"removedExports": [], | ||
"renderedExports": [ | ||
"default", | ||
], | ||
"renderedLength": 49, | ||
}, | ||
"vite-plugin-web-extension/test/manifest/resources/sidePanelHtml/sidepanel.html": { | ||
"code": null, | ||
"originalLength": 228, | ||
"removedExports": [], | ||
"renderedExports": [], | ||
"renderedLength": 0, | ||
}, | ||
"vite-plugin-web-extension/test/manifest/resources/sidePanelHtml/sidepanel.js": { | ||
"code": "log(\\"sidepanel\\");", | ||
"originalLength": 54, | ||
"removedExports": [], | ||
"renderedExports": [], | ||
"renderedLength": 17, | ||
}, | ||
}, | ||
"name": "test/manifest/resources/sidePanelHtml/sidepanel", | ||
"referencedFiles": [], | ||
"type": "chunk", | ||
"viteMetadata": { | ||
"importedAssets": Set {}, | ||
"importedCss": Set {}, | ||
}, | ||
}, | ||
{ | ||
"fileName": "manifest.json", | ||
"name": undefined, | ||
"source": "{ | ||
\\"version\\": \\"1.0.0\\", | ||
\\"name\\": \\"Manifest Name\\", | ||
\\"manifest_version\\": 3, | ||
\\"side_panel\\": { | ||
\\"default_path\\": \\"test/manifest/resources/sidePanelHtml/sidepanel.html\\" | ||
} | ||
}", | ||
"type": "asset", | ||
}, | ||
{ | ||
"fileName": "test/manifest/resources/sidePanelHtml/sidepanel.html", | ||
"name": undefined, | ||
"source": "<!DOCTYPE html> | ||
<html lang=\\"en\\"> | ||
<head> | ||
<meta charset=\\"UTF-8\\" /> | ||
<script type=\\"module\\" src=\\"http://example.com/httpModuleScript.js\\"></script> | ||
<script type=\\"module\\" crossorigin src=\\"/assets/test/manifest/resources/sidePanelHtml/sidepanel.js\\"></script> | ||
</head> | ||
</html> | ||
", | ||
"type": "asset", | ||
}, | ||
] | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<script type="module" src="./sidepanel.js"></script> | ||
|
||
<script type="module" src="http://example.com/httpModuleScript.js"></script> | ||
</head> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import log from "./../shared/log"; | ||
|
||
log("sidepanel"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { getResourceDir, runManifestV3Test } from "./manifestTestUtils"; | ||
|
||
const resourceDir = getResourceDir("sidePanelHtml"); | ||
|
||
runManifestV3Test("sidePanelHtml", () => ({ | ||
side_panel: { | ||
default_path: `${resourceDir}/sidepanel.html`, | ||
}, | ||
})); |