ambitious-restaurant-41333
09/27/2022, 11:21 AMimportScripts() is not supported in module workers
most-account-67892
09/28/2022, 12:40 AMUnable to find any entrypoints
error. I have enabled verbose
mode and found that plasmo
is not resolving/watching for .tsx
files. Is this a known bug?quiet-engine-70935
09/28/2022, 12:40 AMwitty-refrigerator-64444
09/28/2022, 10:05 AMmost-account-67892
09/28/2022, 11:37 AMwith-nextjs
example, is there any way that I can put all of my Plasmo entry points (ie. content.ts/background.ts
) inside ./src/extension
instead of cluttering the ./src
directory?thousands-horse-90118
09/29/2022, 1:23 AMbetter-breakfast-71214
09/30/2022, 2:45 PMthousands-horse-90118
09/30/2022, 10:03 PMquiet-engine-70935
09/30/2022, 10:03 PMred-magazine-81994
10/05/2022, 4:15 AMmatches
and exclude_matches
to avoid the content script from automatically being injected into <all_urls>
2. Created a background script with a call to chrome.scripting.executeScript
on extension click:
import reactRoot from 'url:./react-component';
chrome.action.onClicked.addListener((tab: chrome.tabs.Tab) => {
chrome.scripting.executeScript(
{
target: { tabId: tab.id },
files: [reactRoot.replace(/chrome-extension:\/\/[a-z]*\/([^?]*)\?.*/i, '$1')], // I think executeScript expects a path that is relative to the extension root...
}
)
});
able-art-81693
10/10/2022, 2:27 PMwitty-refrigerator-64444
10/12/2022, 3:56 AMhelpful-twilight-42074
10/12/2022, 8:28 AMambitious-restaurant-41333
10/13/2022, 12:39 PM🔴 ERROR | Unexpected token (parse-error)
| 5: // import { Selectors } from "~utils";
6:
7: export const config: PlasmoContentScript = {
^
8: matches: ["https://steamcommunity.com/*"]
9: };
by parsing
html
<script context="module" lang="ts">
import { PlasmoContentScript } from "plasmo";
export const config: PlasmoContentScript = {
matches: ["https://steamcommunity.com/*"]
};
</script>
ambitious-restaurant-41333
10/13/2022, 12:56 PMsrc
- content.svelte
json
{
"dependencies": {
"plasmo": "0.56.0-alpha.0",
"svelte": "^3.51.0"
},
"devDependencies": {
"typescript": "4.8.4"
}
}
html
<script context="module" lang="ts">
import type { PlasmoContentScript } from "plasmo";
export const config: PlasmoContentScript = {};
</script>
Getting error:
🔴 ERROR | Unexpected token (parse-error)
| 1: <script context="module" lang="ts">
2: import type { PlasmoContentScript } from "plasmo";
^
most-florist-42787
10/13/2022, 12:57 PMmost-florist-42787
10/14/2022, 10:38 AMwitty-refrigerator-64444
10/14/2022, 3:13 PMNODE_ENV
variable to development and production respectively.
Is there any way to override these OR code change would be needed?ambitious-restaurant-41333
10/15/2022, 8:48 AMchilly-grass-58488
10/16/2022, 9:56 PMchrome.runtime
have nothing in it?chilly-grass-58488
10/16/2022, 9:56 PMsticky-dress-98131
10/16/2022, 9:57 PMbrief-pencil-63187
10/17/2022, 3:22 PMcareful-orange-19814
10/23/2022, 1:24 PMflat-state-13182
10/24/2022, 3:13 PMReact.lazy
and React.suspense
in a plasmo extension?
Here's the particular error I'm getting.
css-loader.js:32 GET chrome-extension://gdjdodhempghlamfmddaepeofepfhnbd/linkedin.09792b32.css?1666624251495 net::ERR_FILE_NOT_FOUND
proud-microphone-95412
10/28/2022, 4:26 AMrapid-grass-71498
11/01/2022, 1:32 AMmost-account-67892
11/03/2022, 10:53 AM"paths"
in tsconfig.json
with Plasmo. Trying to set the following, but its not working.
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"],
"~*": ["./src/*"]
}
}
wonderful-jewelry-41731
11/08/2022, 9:50 AMts
import type { PlasmoContentScript, PlasmoGetInlineAnchor } from "plasmo"
export const config: PlasmoContentScript = {
matches: ["<all_urls>"]
}
export const getInlineAnchor: PlasmoGetInlineAnchor = () =>
document.querySelector("body")
// Use this to optimize unmount lookups
export const getShadowHostId = () => "plasmo-inline-example-unique-id"
const PlasmoInline = () => {
return <div style={{backgroundColor:"red"}}>Custom div</div>
}
export default PlasmoInline
ambitious-tomato-67747
11/09/2022, 7:47 AM