|
| 1 | +// Vitest Snapshot v1 |
| 2 | + |
| 3 | +exports[`build fs output > _00 manifest.json 1`] = ` |
| 4 | +Object { |
| 5 | + "action": Object { |
| 6 | + "default_popup": "src/popup.html", |
| 7 | + }, |
| 8 | + "background": Object { |
| 9 | + "service_worker": "service-worker-loader.js", |
| 10 | + "type": "module", |
| 11 | + }, |
| 12 | + "content_scripts": Array [ |
| 13 | + Object { |
| 14 | + "js": Array [ |
| 15 | + "assets/content.js.hash0.js", |
| 16 | + ], |
| 17 | + "matches": Array [ |
| 18 | + "https://a.com/*", |
| 19 | + "http://b.com/*", |
| 20 | + ], |
| 21 | + }, |
| 22 | + ], |
| 23 | + "description": "test extension", |
| 24 | + "host_permissions": Array [ |
| 25 | + "https://c.com/*", |
| 26 | + ], |
| 27 | + "manifest_version": 3, |
| 28 | + "name": "Test Extension", |
| 29 | + "version": "1.0.0", |
| 30 | + "web_accessible_resources": Array [ |
| 31 | + Object { |
| 32 | + "matches": Array [ |
| 33 | + "http://b.com/*", |
| 34 | + "https://a.com/*", |
| 35 | + ], |
| 36 | + "resources": Array [ |
| 37 | + "assets/content.js.hash0.js", |
| 38 | + ], |
| 39 | + "use_dynamic_url": false, |
| 40 | + }, |
| 41 | + ], |
| 42 | +} |
| 43 | +`; |
| 44 | + |
| 45 | +exports[`build fs output > _01 output files 1`] = ` |
| 46 | +Array [ |
| 47 | + "assets/background.js.hash1.js", |
| 48 | + "assets/content.js.hash0.js", |
| 49 | + "assets/popup.html.hash2.js", |
| 50 | + "assets/vendor.hash3.js", |
| 51 | + "manifest.json", |
| 52 | + "service-worker-loader.js", |
| 53 | + "src/popup.html", |
| 54 | +] |
| 55 | +`; |
| 56 | + |
| 57 | +exports[`build fs output > assets/background.js.hash1.js 1`] = ` |
| 58 | +"console.log(\\"service_worker.js\\"); |
| 59 | +" |
| 60 | +`; |
| 61 | + |
| 62 | +exports[`build fs output > assets/content.js.hash0.js 1`] = ` |
| 63 | +"(function(){console.log(\\"content script\\"); |
| 64 | +})() |
| 65 | +" |
| 66 | +`; |
| 67 | + |
| 68 | +exports[`build fs output > assets/popup.html.hash2.js 1`] = ` |
| 69 | +"import { R as React, a as ReactDOM } from \\"./vendor.hash3.js\\"; |
| 70 | +(function polyfill() { |
| 71 | + const relList = document.createElement(\\"link\\").relList; |
| 72 | + if (relList && relList.supports && relList.supports(\\"modulepreload\\")) { |
| 73 | + return; |
| 74 | + } |
| 75 | + for (const link of document.querySelectorAll('link[rel=\\"modulepreload\\"]')) { |
| 76 | + processPreload(link); |
| 77 | + } |
| 78 | + new MutationObserver((mutations) => { |
| 79 | + for (const mutation of mutations) { |
| 80 | + if (mutation.type !== \\"childList\\") { |
| 81 | + continue; |
| 82 | + } |
| 83 | + for (const node of mutation.addedNodes) { |
| 84 | + if (node.tagName === \\"LINK\\" && node.rel === \\"modulepreload\\") |
| 85 | + processPreload(node); |
| 86 | + } |
| 87 | + } |
| 88 | + }).observe(document, { childList: true, subtree: true }); |
| 89 | + function getFetchOpts(script) { |
| 90 | + const fetchOpts = {}; |
| 91 | + if (script.integrity) |
| 92 | + fetchOpts.integrity = script.integrity; |
| 93 | + if (script.referrerpolicy) |
| 94 | + fetchOpts.referrerPolicy = script.referrerpolicy; |
| 95 | + if (script.crossorigin === \\"use-credentials\\") |
| 96 | + fetchOpts.credentials = \\"include\\"; |
| 97 | + else if (script.crossorigin === \\"anonymous\\") |
| 98 | + fetchOpts.credentials = \\"omit\\"; |
| 99 | + else |
| 100 | + fetchOpts.credentials = \\"same-origin\\"; |
| 101 | + return fetchOpts; |
| 102 | + } |
| 103 | + function processPreload(link) { |
| 104 | + if (link.ep) |
| 105 | + return; |
| 106 | + link.ep = true; |
| 107 | + const fetchOpts = getFetchOpts(link); |
| 108 | + fetch(link.href, fetchOpts); |
| 109 | + } |
| 110 | +})(); |
| 111 | +const App = () => { |
| 112 | + return /* @__PURE__ */ React.createElement(\\"div\\", null, /* @__PURE__ */ React.createElement(\\"h1\\", null, \\"Popup Page\\"), /* @__PURE__ */ React.createElement(\\"p\\", null, \\"If you are seeing this, React is working!\\")); |
| 113 | +}; |
| 114 | +console.log(\\"popup script\\"); |
| 115 | +const root = document.querySelector(\\"#root\\"); |
| 116 | +ReactDOM.render(/* @__PURE__ */ React.createElement(App, null), root); |
| 117 | +" |
| 118 | +`; |
| 119 | + |
| 120 | +exports[`build fs output > service-worker-loader.js 1`] = ` |
| 121 | +"import './assets/background.js.hash1.js'; |
| 122 | +" |
| 123 | +`; |
| 124 | + |
| 125 | +exports[`build fs output > src/popup.html 1`] = ` |
| 126 | +"<!DOCTYPE html> |
| 127 | +<html lang=\\"en\\"> |
| 128 | + <head> |
| 129 | + <meta charset=\\"UTF-8\\" /> |
| 130 | + <meta name=\\"viewport\\" content=\\"width=1000, initial-scale=1.0\\" /> |
| 131 | + <title>Popup Page</title> |
| 132 | + <script type=\\"module\\" crossorigin src=\\"/assets/popup.html.hash2.js\\"></script> |
| 133 | + <link rel=\\"modulepreload\\" crossorigin href=\\"/assets/vendor.hash3.js\\"> |
| 134 | + </head> |
| 135 | + <body> |
| 136 | + <div id=\\"root\\"></div> |
| 137 | + |
| 138 | + </body> |
| 139 | +</html> |
| 140 | +" |
| 141 | +`; |
0 commit comments