Skip to content

Commit bcde05f

Browse files
committed
update twitch element and allow new floatplane live url
1 parent 79e3a7e commit bcde05f

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/inserter.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,19 @@ let lastLatenessVoting;
55
let iframe;
66
let chatIframe;
77

8+
89
const br = typeof browser === "undefined" ? chrome : browser;
910

1011
async function replace() {
1112

13+
1214
const domain = location.hostname.toLowerCase();
1315

1416
const isFloatplane = domain.includes("floatplane.com");
1517
const isTwitch = domain.includes("twitch.tv");
1618
const isYoutube = domain.includes("youtube.com");
1719

18-
const isBoca = isTwitch && location.pathname.toLowerCase() === "/bocabola_";
20+
const isBoca = isTwitch && location.pathname.toLowerCase() === "/bocabola";
1921

2022
if(
2123

@@ -32,22 +34,22 @@ async function replace() {
3234
if(isYoutube) return; // no live widget for youtube
3335

3436
// We have to check here instead of in the manifest because the script isnt loaded when navigating client-side
35-
if(isFloatplane && location.pathname !== "/channel/linustechtips/live") return;
37+
if(isFloatplane && !["/channel/linustechtips/live", "/live/linustechtips"].includes(location.pathname)) return;
3638
if(isTwitch && location.pathname.toLowerCase() !== "/linustech" && !isBoca) return;
3739

3840
let element = null;
3941
if(isFloatplane) element =
4042
document.querySelector("._offlineContainer_1l3w1_1") ??
4143
document.querySelector("._offlineContainer_n75ld_1") ??
4244
document.querySelector("div.av-player-control-wrapper > div.livestream-offline-container");
43-
if(isTwitch) element = document.querySelector("div.gMJXeQ:nth-child(1) > div:nth-child(1):not(.SugpE)");
45+
if(isTwitch) element = document.querySelector("div.fHKOqA:nth-child(1) > div:nth-child(1):not(.SugpE)");
4446

4547
let chatElement = null
4648
if(isFloatplane) chatElement =
4749
document.querySelector("div.chat-message-list:nth-child(1)") ??
4850
document.querySelector(".live-chat-panel-container > .live-chat-message-list-wrapper") ??
4951
document.querySelector(".live-chat-message-list-wrapper");
50-
if(isTwitch) chatElement = document.querySelector(".iWWhvN > div:nth-child(2) > div:nth-child(3)")
52+
if(isTwitch) chatElement = document.querySelector(".etHxQt > div:nth-child(2)");
5153

5254
if(!isBoca && element != null) {
5355

0 commit comments

Comments
 (0)