AdguardTeam / AdguardBrowserExtension

AdGuard browser extension
https://adguard.com/
GNU General Public License v3.0
3.07k stars 329 forks source link

In some case `$replace` rule breaks video player #2038

Closed AdamWr closed 2 years ago

AdamWr commented 2 years ago

Issue Details

Steps to reproduce

  1. Add this rule:
    /playback/v3/videoPlaybackInfo$replace=/("vendorAttributes" : {)[\s\S]*?}\,[\s\S]*?("streaming")/\$1}}\,\n\$2/,domain=go.discovery.com|discoveryplus.com|go.tlc.com|watch.hgtv.com|investigationdiscovery.com|sciencechannel.com
  2. Go to - https://go.discovery.com/video/alaska-the-last-frontier-discovery/a-whole-new-frontier US IP needed.

Expected Behavior

Video player should works fine.

Actual Behavior

Video player is broken. It seems that it's due to \n in $replace rule.

Screenshots

Screenshot: ![image](https://user-images.githubusercontent.com/29142494/162000889-6d44a35d-5944-4073-9f52-0058c709f93a.png)
Birbber commented 2 years ago

@AdamWr I wasn't able to reproduce it.

AdamWr commented 2 years ago

I still can reproduce it, if I add mentioned rule to user rules.

Screenshot ![image](https://user-images.githubusercontent.com/29142494/164228506-229a374e-e19b-4f7e-805c-c7fa1755454b.png)

If rule is not added (or if \n is removed from the rule), then video works fine.

Screenshot ![image](https://user-images.githubusercontent.com/29142494/164228766-6724aa02-e459-402f-a382-261db3f87bf6.png)
github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.