Skip to content

Commit

Permalink
update frame url detection
Browse files Browse the repository at this point in the history
  • Loading branch information
Vendicated committed May 26, 2024
1 parent 875072c commit 9fbb9fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/build/common.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export const fileUrlPlugin = {
write: false,
minify: true,
bundle: true,
format: "esm"
format: "iife"
});
content = res.outputFiles[0].text;
} else {
Expand Down
4 changes: 3 additions & 1 deletion src/plugins/watchTogetherAdblock.desktop/native.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import adguard from "file://adguard.js?minify";
app.on("browser-window-created", (_, win) => {
win.webContents.on("frame-created", (_, { frame }) => {
frame.once("dom-ready", () => {
if (frame.url.startsWith("https://880218394199220334.discordsays.com")) {
console.log(frame.url);
if (frame.url.includes("discordsays") && frame.url.includes("youtube.com")) {
console.log("injecting");
if (!RendererSettings.store.plugins?.WatchTogetherAdblock?.enabled) return;

frame.executeJavaScript(adguard);
Expand Down

0 comments on commit 9fbb9fe

Please sign in to comment.