hperrin / stream-overlay

Show borderless, transparent, click-through browser windows for streaming on Windows and Linux.
Apache License 2.0
12 stars 2 forks source link

Twitch Alerts not being shown when using Twitch alerts URL #3

Open nicholasmartin opened 6 months ago

nicholasmartin commented 6 months ago

Thanks again for this amazing app! I never miss a chat now and I love it!

I recently switched to Twitch native notifications from Streamlabs and since then the notifications stopped working through Stream-Overlay. They show up fine in OBS but just not on my screen so I have missed a few follows.

Has something changed? Maybe with the latest releases of OBS?

hperrin commented 6 months ago

I haven't heard of any change. I can try updating to the latest version of Electron, but the latest version is only a month old, so should be supported. Are you on Windows?

nicholasmartin commented 6 months ago

Yes Im on Windows 11 Pro

ronttizz commented 6 months ago

This might be duplicate of the issue https://github.com/hperrin/stream-overlay/issues/2

markst32 commented 2 months ago

I also experienced the same issue recently (Linux - Pop OS). Seems like twitch restricted (or prohibited?) possibility to show alerts while it's embedded. I fixed it locally by adding a few lines of code, but I can't commit to this repository. Here is the patch with these changes:

diff --git a/app/src/main.ts b/app/src/main.ts
index 0cec50a..f791f0e 100644
--- a/app/src/main.ts
+++ b/app/src/main.ts
@@ -27,6 +27,7 @@ const DEFAULT_X = -1;
 const DEFAULT_Y = -1;
 const DEFAULT_OPACITY = 1;
 const DEFAULT_FULLSCREEN = false;
+const NOT_EMBEDDABLE_PROVIDERS_URL_PREFIXES = ['https://dashboard.twitch.tv', 'https://www.twitch.tv'];

 type Conf = {
   url: string;
@@ -286,7 +287,11 @@ const createOverlayWindow = (conf: Conf, interactable = false) => {

   const timer = setInterval(() => win.moveTop(), 1000);

-  win.loadFile(path.join(__dirname, '..', 'assets', 'page.html'));
+  if (NOT_EMBEDDABLE_PROVIDERS_URL_PREFIXES.some(providerPrefix => conf.url.startsWith(providerPrefix))) {
+    win.loadURL(conf.url);
+  } else {
+    win.loadFile(path.join(__dirname, '..', 'assets', 'page.html'));
+  }

   // Emitted when the window is closed.
   win.on('closed', () => {
hperrin commented 2 months ago

I fixed it locally by adding a few lines of code, but I can't commit to this repository. Here is the patch with these changes:

@markst32 Awesome! Thank you for the fix! Can you send me a pull request?

If not, I can put the fix in myself, but I'd rather you get the credit as the contributor for writing the fix.

markst32 commented 2 months ago

@hperrin created it. Sorry for the delay, I didn't know that I have to create fork before trying to make changes.