Fixes #7170 paywall on foreignpolicy.com #7171
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This removes the paywall on foreignpolicy.com
The two lines below may seem a bit redundant since this is the same element but the JavaScript on the page removes and adds this class back so this catches that, otherwise it flashes a dark modal background for a second.
foreignpolicy.com##div.tp-backdrop
foreignpolicy.com##.tp-active.tp-backdrop
URL(s) where the issue occurs
https://foreignpolicy.com/2020/03/25/blame-china-and-xi-jinping-for-coronavirus-pandemic/
Describe the issue
Modal popup with a paywall
This fixes #7170
Versions
Settings
Notes
After hitting a paywall I created the following rules to start with:
Then started with adding breakpoints to since I noticed it is replacing classes for the paywall to appear. the class
tp-modal-open
on the tag was blocking scrolling on the page so I created a filter which has more specific selector which overwrites those blocking values toauto
.tp-modal-resizing
is a class that gets added to the tag but it doesn't affect the page visual so I didn't create a rule for it.At this point the paywall was removed but there was still a quick flash of black on the page when it popped up and before it was removed after a bit of investigating and adding breakpoints to the page to catch DOM attribute modifications I noticed
div.tp-backdrop.tp-active
was modifying it's class attribute and removing thetp-active
class, this breaks the rules I added to block the paywall. It's a simple fix, create two rules, one with and one without thetp-active
class.