-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
842 additions
and
201 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@crxjs/vite-plugin": patch | ||
--- | ||
|
||
fix: hmr error |
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,5 @@ | ||
--- | ||
"@crxjs/vite-plugin": patch | ||
--- | ||
|
||
Fix/web accessible resources script modules |
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,5 @@ | ||
--- | ||
"@crxjs/vite-plugin": patch | ||
--- | ||
|
||
Delete invalid changeset |
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,5 @@ | ||
--- | ||
"@crxjs/vite-plugin": patch | ||
--- | ||
|
||
fix: background scripts for firefox build |
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,5 @@ | ||
--- | ||
"@crxjs/vite-plugin": patch | ||
--- | ||
|
||
feat: add compatibility mode for Firefox |
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,5 @@ | ||
--- | ||
"rollup-plugin-chrome-extension": patch | ||
--- | ||
|
||
Add match_origin_as_fallback to manifest-v3.schema.json |
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,6 @@ | ||
--- | ||
'@crxjs/vite-plugin': patch | ||
--- | ||
|
||
Vite 5 moved vite manifest from 'manifest.json' to '.vite/manifest.json'. | ||
This change updates the plugin to use the new location if Vite major version is >4, old location otherwise. |
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
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
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
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
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,64 @@ | ||
/** | ||
* This script runs in Vite dev mode if an extension page opens before the | ||
* service worker takes control of fetch (e.g., in the onInstalled event). | ||
*/ | ||
|
||
const VITE_URL = 'http://localhost:%PORT%' | ||
|
||
document.body.innerHTML = ` | ||
<div | ||
id="app" | ||
style=" | ||
border: 1px solid #ddd; | ||
padding: 20px; | ||
border-radius: 5px; | ||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); | ||
" | ||
> | ||
<h1 style="color: #333">Vite Dev Mode</h1> | ||
<p style="color: #666"> | ||
Cannot connect to the Vite Dev Server on <a href="${VITE_URL}">${VITE_URL}</a> | ||
</p> | ||
<p style="color: #666"> | ||
Double-check that Vite is working and reload the extension. | ||
</p> | ||
<p style="color: #666"> | ||
This page will close when the extension reloads. | ||
</p> | ||
<button | ||
style=" | ||
padding: 10px 20px; | ||
border: none; | ||
background-color: #007bff; | ||
color: #fff; | ||
border-radius: 5px; | ||
cursor: pointer; | ||
" | ||
> | ||
Reload Extension | ||
</button> | ||
</div>` | ||
document.body.querySelector('button')?.addEventListener('click', () => { | ||
chrome.runtime.reload() | ||
}) | ||
|
||
// ping the dev server until it's ready | ||
let tries = 0 | ||
let ready = false | ||
do { | ||
try { | ||
await fetch(VITE_URL) | ||
ready = true | ||
} catch { | ||
// exponential backoff for retries, maxing out at every 5 seconds | ||
const timeout = Math.min(100 * Math.pow(2, ++tries), 5000) | ||
console.log(`[CRXJS] Vite Dev Server is not available on ${VITE_URL}`) | ||
console.log(`[CRXJS] Retrying in ${timeout}ms...`) | ||
await new Promise((resolve) => setTimeout(resolve, timeout)) | ||
} | ||
} while (!ready) | ||
|
||
// reload the page to load the built files from the dev server | ||
location.reload() | ||
|
||
export {} |
10 changes: 0 additions & 10 deletions
10
packages/vite-plugin/src/client/es/page-precontroller-script.ts
This file was deleted.
Oops, something went wrong.
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,12 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title>Vite Dev Mode</title> | ||
<script src="%SCRIPT%" type="module"></script> | ||
</head> | ||
<body | ||
style="font-family: Arial, sans-serif; padding: 20px; text-align: center" | ||
> | ||
<h1>Vite Dev Mode</h1> | ||
</body> | ||
</html> |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.