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

Scriptlets: inject quoted arguments without quotes #3559

Merged
merged 1 commit into from
Oct 30, 2023

Conversation

chrmod
Copy link
Member

@chrmod chrmod commented Oct 28, 2023

This is required for scriptlets like:

www.youtube.com##+js(rpnt, script, /(\(function serverContract\(\))/, '/*start*/(function(){const e={apply:(e,a,r)=>{if(Array.isArray(r)){const e=r[0];(e.adPlacements||e.adSlots||e.adBreakHeartbeatParams||e.playerResponse)&&(r=[{}])}return Reflect.apply(e,a,r)}};Object.getOwnPropertyNames=new Proxy(Object.getOwnPropertyNames,e);let t=function(){document.querySelectorAll("script").forEach(e=>{e.textContent=e.textContent.replace(/\/\*start\*\/(.*)\/\*end\*\//g,"")})};"loading"!==document.readyState?t():document.addEventListener("DOMContentLoaded",t)}());/*end*/ $1')

The last argument is quoted but should be used without the quotes.

fix ghostery/ghostery-extension#1360

@philipp-classen philipp-classen merged commit 240308d into master Oct 30, 2023
3 checks passed
@philipp-classen philipp-classen deleted the scriptlets-quoted-arguments branch October 30, 2023 10:18
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.

broken page (https://www.youtube.com/)
2 participants