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

Add Youtube wall popup to v10 #1387

Merged
merged 3 commits into from
Nov 21, 2023
Merged

Add Youtube wall popup to v10 #1387

merged 3 commits into from
Nov 21, 2023

Conversation

smalluban
Copy link
Collaborator

@smalluban smalluban commented Nov 17, 2023

  • Moves the UI for the Youtube wall popup into the packages/ui
  • Unify logic for v8 and v10
  • Adds a condition for showIframe to detect if the iframe is already shown
  • Adds detectWall function
  • Hides popup when "Open YouTube in a private window" is clicked

The current logic detects changes in the DOM and checks if the URL has changed. If so, selectors for the wall are checked if exists, and then we trigger showing up the iframe. As the iframe blocks displaying more than once, it triggers each time the selectors are found.

For the notice, Safari chrome.windows.create() silently returns a resolved promise if the extension is not allowed in private mode. The chrome.extension.inIncognitoContext also always returns false.

@smalluban smalluban requested a review from chrmod November 17, 2023 15:11
@smalluban smalluban marked this pull request as draft November 17, 2023 18:02
@smalluban
Copy link
Collaborator Author

Initial @kalinme testing failed.

@smalluban smalluban marked this pull request as ready for review November 20, 2023 13:45
window.addEventListener('yt-navigate-start', () => closeIframe(), true);

detectWall(async () => {
if (await isFeatureDisabled()) return;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

YT page is long living app, so the condition must be checked each time - not only at startup (applies to v8 & v10).

@smalluban smalluban added the package CI: create extension packages label Nov 20, 2023
@smalluban smalluban force-pushed the fix-youtube-wall-popup branch from 66a6514 to ec77e51 Compare November 20, 2023 14:11
Copy link
Member

@chrmod chrmod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@smalluban smalluban merged commit 7c6bc15 into main Nov 21, 2023
2 checks passed
@smalluban smalluban deleted the fix-youtube-wall-popup branch November 21, 2023 07:28
@smalluban smalluban mentioned this pull request Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package CI: create extension packages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants