Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nicholasmartin opened this issue Apr 14, 2024 · 7 comments
Open

Comments

@nicholasmartin
Copy link

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
Copy link
Owner

hperrin commented Apr 15, 2024

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
Copy link
Author

Yes Im on Windows 11 Pro

@nicholasmartin nicholasmartin changed the title Twitch Alerts not being shown Twitch Alerts not being shown when using Twitch alerts URL Apr 16, 2024
@ronttizz
Copy link

This might be duplicate of the issue #2

@markst32
Copy link

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
Copy link
Owner

hperrin commented Aug 21, 2024

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
Copy link

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

@markst32
Copy link

@hperrin Could you please review the following PR? #5
I closed the previous PR with hard-coded Twitch-only fix and decided to go with more flexible solution. I think it's better to let user have control over it, because this way user can fix this issue not only for overlays from Twitch, but also for other providers who uses the same restrictions for embedding their pages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants