Skip to content

Display Click to Load placeholders on demand #287

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 3, 2023

Conversation

kzar
Copy link
Contributor

@kzar kzar commented Feb 27, 2023

Historically, the Click to Load placeholders were only drawn once at
the point page load completed. That had two problems:

  1. Sometimes placeholders would take too long to display, if the page
    took a long time to load fully.
  2. Sometimes placeholders would not be displayed at all, if the
    blocked content was only created after page load had finished.

To fix that, let's display the placeholders when instructed by the
platform using a "displayClickToLoadPlaceholders" update message.

Let's also restructure the response messages, so that they can be
clearly distinguished.

@kzar kzar force-pushed the ctl-placeholder-on-block branch 3 times, most recently from 77d57ad to cb97543 Compare February 28, 2023 18:35
@kzar kzar force-pushed the ctl-placeholder-on-block branch from cb97543 to 18796b1 Compare March 1, 2023 13:28
@kzar kzar marked this pull request as ready for review March 1, 2023 14:11
Historically, the Click to Load placeholders were only drawn once at
the point page load completed. That had two problems:
1. Sometimes placeholders would take too long to display, if the page
   took a long time to load fully.
2. Sometimes placeholders would not be displayed at all, if the
   blocked content was only created after page load had finished.

To fix that, let's display the placeholders when instructed by the
platform using a "displayClickToLoadPlaceholders" update message.

Let's also restructure the response messages, so that they can be
clearly distinguished.
@kzar kzar force-pushed the ctl-placeholder-on-block branch from 18796b1 to a035a24 Compare March 2, 2023 17:52
@ladamski
Copy link
Contributor

ladamski commented Mar 3, 2023

Ok I'm having one issue but its annoying to repro. Basically after the browser has been open for a while (couple hours) CTL is no longer being applied to any page (whether I reload, open a new tab, etc). Maybe the background script is getting killed and not restarting?

@kzar kzar merged commit 46ca757 into duckduckgo:main Mar 3, 2023
@kzar
Copy link
Contributor Author

kzar commented Mar 3, 2023

Ok I'm having one issue but its annoying to repro. Basically after the browser has been open for a while (couple hours) CTL is no longer being applied to any page (whether I reload, open a new tab, etc). Maybe the background script is getting killed and not restarting?

Weird. OK I have filed a task in Asana to investigate that.

kzar added a commit to kzar/content-scope-scripts that referenced this pull request Mar 3, 2023
This reverts commit 46ca757. The
change was causing an integration test failure, which we ran out of
time to debug. We will investigate and reapply this shortly.
kzar added a commit that referenced this pull request Mar 3, 2023
This reverts commit 46ca757. The
change was causing an integration test failure, which we ran out of
time to debug. We will investigate and reapply this shortly.
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.

3 participants