Skip to content

Commit 141e066

Browse files
committed
2.7.1 load content script by URL on chrome and inline for firefox
Closes #450 chore: increase cypress retries (#448)
1 parent 978addc commit 141e066

File tree

5 files changed

+16
-9
lines changed

5 files changed

+16
-9
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@ Due to Chrome's Manifest v3 rollout, the extension had to be rewritten. As part
1414
- ✅ Highlight component in page on hover
1515
- ✅ Component data in console globals
1616
- ✅ High performance on nested data objects (🆕️, tested on ~10k data properties)
17+
- ✅ Component filtering (🆕)
1718

1819
**Early Access** includes:
1920

2021
- ✅ Store state viewing/editing (🆕)
2122
- ✅ Store data in console globals (🆕)
2223
- ✅ Warnings tab (inc. Alpine v3 support)
2324
- ✅ Jump to root element/scroll element into view (🆕)
24-
- 🔜 Time travel debugging of $data (🆕)
25+
- Time travel debugging of $data (🆕)
2526

2627
# Alpine.js devtools
2728

packages/browser-extension/cypress.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default defineConfig({
55
fixturesFolder: false,
66
chromeWebSecurity: false,
77
retries: {
8-
runMode: 1,
8+
runMode: 2,
99
},
1010

1111
e2e: {

packages/browser-extension/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "Alpine.js devtools - Early Access",
33
"description": "DevTools extension for debugging Alpine.js applications.",
4-
"version": "2.7.0",
4+
"version": "2.7.1",
55
"manifest_version": 3,
66
"icons": {
77
"16": "icons/16.png",

packages/browser-extension/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "browser-extension",
33
"private": true,
4-
"version": "2.7.0",
4+
"version": "2.7.1",
55
"description": "Alpine.js devtools with Chrome manifest v3 compatibility",
66
"type": "module",
77
"scripts": {

packages/browser-extension/src/scripts/content.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,17 @@ import { CONTENT } from '../devtools/ports';
33
function loadScriptInRealWorld(path: string) {
44
return new Promise(async (resolve, reject) => {
55
const script = document.createElement('script');
6-
// Was originally:
7-
// script.src = chrome.runtime.getURL(path)
8-
// which causes issues on sites with CSPs, see:
9-
// https://github.com/alpine-collective/alpinejs-devtools/issues/445
10-
script.innerHTML = await fetch(chrome.runtime.getURL(path)).then((res) => res.text());
6+
7+
const scriptPath = chrome.runtime.getURL(path);
8+
if (scriptPath.startsWith('chrome-extension://')) {
9+
script.src = chrome.runtime.getURL(path);
10+
} else {
11+
// On Firefox, loading from the extension path causes issues with
12+
// with CSPs, see:
13+
// https://github.com/alpine-collective/alpinejs-devtools/issues/445
14+
script.innerHTML = await fetch(scriptPath).then((res) => res.text());
15+
}
16+
1117
script.type = 'module';
1218

1319
script.addEventListener('error', (err) => reject(err));

0 commit comments

Comments
 (0)