Skip to content

Remove unused (and broken) hideTrackingElement Click to Load code path #357

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

Merged
merged 1 commit into from
Mar 29, 2023

Conversation

kzar
Copy link
Contributor

@kzar kzar commented Mar 28, 2023

The hideTrackingElement code path was originally intended for use with
YouTube Click to Load placeholders. The thinking was to keep the
original YouTube video elements on the page, in case the website
referenced the original element when creating a video.

Unfortunately that didn't work out, since keeping the original element
on the page caused problems such as duplicate placeholders being
displayed. We already stopped using that code path, let's tidy things
up and remove it.

Testing notes

  • Click to Load YouTube is not fixed with this change, this is just to lay the groundwork.
  • Ensure the Playwright Click to Load Facebook integration tests still pass, and that Click to Load Facebook works OK in practice.

@kzar kzar requested a review from franfaccin March 28, 2023 11:15
@kzar kzar requested a review from ladamski as a code owner March 28, 2023 11:15
@kzar kzar force-pushed the fix-ctl-youtube-placeholders-p1 branch 4 times, most recently from 81a45ad to e1063e4 Compare March 28, 2023 13:52
@kzar kzar force-pushed the fix-ctl-youtube-placeholders-p1 branch 3 times, most recently from 6d9e854 to 74106a9 Compare March 28, 2023 16:31
The hideTrackingElement code path was originally intended for use with
YouTube Click to Load placeholders. The thinking was to keep the
original YouTube video elements on the page, in case the website
referenced the original element when creating a video.

Unfortunately that didn't work out, since keeping the original element
on the page caused problems such as duplicate placeholders being
displayed. We already stopped using that code path, let's tidy things
up and remove it.

While we're at it, let's fix the element resizing for Chrome MV3
builds. It turns out that when the declarativeNetRequest API blocks
an element, the element is automatically "collapsed" (hidden). When
this happens, getBoundingClientRect() considers the element to have a
width and height of 0. Fall back to getComputedStyle when that
happens.
@kzar kzar force-pushed the fix-ctl-youtube-placeholders-p1 branch from 74106a9 to 5a74de1 Compare March 28, 2023 16:31
Copy link
Contributor

@franfaccin franfaccin left a comment

Choose a reason for hiding this comment

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

I've tested again and all seems to be working well. Great job ✅

@kzar kzar merged commit 812dbaf into duckduckgo:main Mar 29, 2023
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

Successfully merging this pull request may close these issues.

2 participants