Comments (5)
I did some more debugging and it appears to be because of using the asterisk as an identifier in "matches": [ "*" ]
.
I just tried with <all_urls>
and the extension runs correctly.
FYI, here's the output from addons-linter
Code Message Description File Line Column
JSON_INVALID "/content_scripts/0/matche… Your JSON file could not be parsed.
s/0" should be equal to one
of the allowed values
JSON_INVALID "/content_scripts/0/matche… Your JSON file could not be parsed.
s/0" should match pattern
"^(https?|wss?|file|ftp|\*…
)://(\*|\*\.[^*/]+|[^*/]+)…
/.*$"
JSON_INVALID "/content_scripts/0/matche… Your JSON file could not be parsed.
s/0" should match pattern
"^file:///.*$"
JSON_INVALID "/content_scripts/0/matche… Your JSON file could not be parsed.
s/0" is not a valid key or
has invalid extra
properties
JSON_INVALID "/content_scripts/0/matche… Your JSON file could not be parsed.
s/0" should match pattern
"^resource://(\*|\*\.[^*/]…
+|[^*/]+)/.*$|^about:"
from web-ext-react.
Can you post the whole extension/manifest.json
file, or even better your project and I can take a look.
from web-ext-react.
Right now I'm trying to use your example from web-ext-react-hello and build on that.
The only changed files are:
extension/manifest.json
{
"description": "Bundle ReactJS as web extension",
"manifest_version": 2,
"name": "web-ext-react-hello",
"version": "1.0",
"homepage_url": "https://github.com/mrloop/web-ext-react-hello",
"icons": {
"192": "logo192.png"
},
"browser_action": {
"default_icon": "logo192.png",
"default_title": "Hello WebExt",
"default_popup": "popup.html"
},
"content_scripts": [
{
"matches": [
"*"
],
"js": [],
"css": []
}
],
"background": {
"page": "background-page.html"
}
}
src/index.js
import React from "react";
import ReactDOM from "react-dom";
import "./index.css";
import App from "./App";
import * as serviceWorker from "./serviceWorker";
if (document.isBackground) {
// some background script
console.log("Background script");
} else if (document.isBrowserAction) {
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById("root")
);
} else if (document.isContentScripts) {
console.log("I'm a content script");
}
// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();
from web-ext-react.
Thanks @Barabazs have updated docs
from web-ext-react.
Thanks!
from web-ext-react.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from web-ext-react.