Avi
Avi
Explore posts from servers
PD🧩 Plasmo Developers
Created by Kurohyou on 11/7/2024 in #🔰newbie
SWC not resolving
@lab know the culprit?
5 replies
PD🧩 Plasmo Developers
Created by Avi on 9/21/2024 in #🔰newbie
Adding alias
So far the only solution I found is
{
"compilerOptions": {
"baseUrl": ".",
"types": ["node", "svelte", "chrome"],
"module": "None",
"target": "ESNext",
"verbatimModuleSyntax": false,
"esModuleInterop": true,
"paths": {
"~*": ["./src/*"] // removed ~~*
},
"resolveJsonModule": true
},
"extends": "plasmo/templates/tsconfig.base",
"exclude": ["node_modules"],
"include": [".plasmo/index.d.ts", "./**/*.ts", "./**/*.svelte"],
"references": [
{
"path": "../types-lib"
}
]
}
{
"compilerOptions": {
"baseUrl": ".",
"types": ["node", "svelte", "chrome"],
"module": "None",
"target": "ESNext",
"verbatimModuleSyntax": false,
"esModuleInterop": true,
"paths": {
"~*": ["./src/*"] // removed ~~*
},
"resolveJsonModule": true
},
"extends": "plasmo/templates/tsconfig.base",
"exclude": ["node_modules"],
"include": [".plasmo/index.d.ts", "./**/*.ts", "./**/*.svelte"],
"references": [
{
"path": "../types-lib"
}
]
}
<script lang="ts">
import { RelationshipMode } from "../../../../../types-lib/src/types-matchmaking";
// ..
</script>
<script lang="ts">
import { RelationshipMode } from "../../../../../types-lib/src/types-matchmaking";
// ..
</script>
6 replies
PD🧩 Plasmo Developers
Created by Avi on 9/21/2024 in #🔰newbie
Adding alias
No description
6 replies
PD🧩 Plasmo Developers
Created by mov ecx, 420 on 8/7/2024 in #👾extension
Registering a content message from a library
by "directly" it's like with normal TypeScript where it just copies the function snippets into your script by "indirectly" you're creating a separated script and the concept can be used regardless of Plasmo
14 replies
PD🧩 Plasmo Developers
Created by mov ecx, 420 on 8/7/2024 in #👾extension
Registering a content message from a library
Let me introduce a slight correction: Chrome's MV3 only allows you to define a single script as the background script Plasmo lets you import the rest of the scripts directly or indirectly Directly:
// some-script.ts
export function someFunc() {...}
// some-script.ts
export function someFunc() {...}
// background.ts
import { someFunc } from "~scripts/some-script";
// background.ts
import { someFunc } from "~scripts/some-script";
Indirectly:
// webworker.ts
function someWork() {...}
someWork();
// webworker.ts
function someWork() {...}
someWork();
// background.ts
import pathWorker from "url:~webworker.ts";

const worker = new Worker(pathWorker);
worker.addEventListener("message", () => {...});
worker.postMessage(...);
// background.ts
import pathWorker from "url:~webworker.ts";

const worker = new Worker(pathWorker);
worker.addEventListener("message", () => {...});
worker.postMessage(...);
or
<!-- offscreen.html -->
<script src="offscreen.ts" type="module"></script>
<!-- offscreen.html -->
<script src="offscreen.ts" type="module"></script>
// offscreen.ts
chrome.runtime.onConnect.addListener(async port => {
// ...
});
// offscreen.ts
chrome.runtime.onConnect.addListener(async port => {
// ...
});
// background.ts
import pathOffset from "raw:~offscreen.html";

// register OffscreenDocument
// background.ts
import pathOffset from "raw:~offscreen.html";

// register OffscreenDocument
14 replies
PD🧩 Plasmo Developers
Created by mov ecx, 420 on 8/7/2024 in #👾extension
Registering a content message from a library
It's good to package your Fetch call in a function but sometimes it's better to duplicate the code so it's easier to debug
14 replies
PD🧩 Plasmo Developers
Created by mov ecx, 420 on 8/7/2024 in #👾extension
Registering a content message from a library
So you have two choices: seek a module in NPM or make one yourself
14 replies
PD🧩 Plasmo Developers
Created by mov ecx, 420 on 8/7/2024 in #👾extension
Registering a content message from a library
Why not just use Fetch? Often it's better to just use the native solution, this way if you get an error the call stack is clear
14 replies
PD🧩 Plasmo Developers
Created by evan on 10/29/2023 in #👟framework
CSUI main world on Firefox MV2 (Unexpected property "world" for scripting.registerContentScripts)
I'll have to figure out a workaround for YTTM as well 😅
56 replies
PD🧩 Plasmo Developers
Created by evan on 10/29/2023 in #👟framework
CSUI main world on Firefox MV2 (Unexpected property "world" for scripting.registerContentScripts)
IKR 😬
56 replies
PD🧩 Plasmo Developers
Created by evan on 10/29/2023 in #👟framework
CSUI main world on Firefox MV2 (Unexpected property "world" for scripting.registerContentScripts)
56 replies
PD🧩 Plasmo Developers
Created by evan on 10/29/2023 in #👟framework
CSUI main world on Firefox MV2 (Unexpected property "world" for scripting.registerContentScripts)
56 replies
PD🧩 Plasmo Developers
Created by evan on 10/29/2023 in #👟framework
CSUI main world on Firefox MV2 (Unexpected property "world" for scripting.registerContentScripts)
56 replies
PD🧩 Plasmo Developers
Created by blackawn on 7/3/2024 in #👟framework
Build config
@blackawn I mean you can do
if (process.env.NODE_ENV === "development") {
console.log(...)
}
if (process.env.NODE_ENV === "development") {
console.log(...)
}
4 replies
PD🧩 Plasmo Developers
Created by Execade on 3/8/2023 in #🔰newbie
captureVisibleTab()
Can you make a repo to demonstrate a POC?
74 replies
PD🧩 Plasmo Developers
Created by Execade on 3/8/2023 in #🔰newbie
captureVisibleTab()
You will have to invoke the ext in one of the 4 aforementioned ways to take the screenshot
74 replies
PD🧩 Plasmo Developers
Created by Execade on 3/8/2023 in #🔰newbie
captureVisibleTab()
To my understanding, according to the screenshot I shared, you cannot work around it; it's a limitation in the API
74 replies
PD🧩 Plasmo Developers
Created by Execade on 3/8/2023 in #🔰newbie
captureVisibleTab()
No description
74 replies
PD🧩 Plasmo Developers
Created by Execade on 3/8/2023 in #🔰newbie
captureVisibleTab()
I'll admit that I haven't actually tried, I typed it on my phone and assumed it works 😅
74 replies
PD🧩 Plasmo Developers
Created by Execade on 3/8/2023 in #🔰newbie
captureVisibleTab()
This question is from 2016, might not be applicable to Manifest V3
74 replies