{"action":"created","issue":{"url":"https://api.github.com/repos/chrisaljoudi/uBlock/issues/1255","labels_url":"https://api.github.com/repos/chrisaljoudi/uBlock/issues/1255/labels{/name}","comments_url":"https://api.github.com/repos/chrisaljoudi/uBlock/issues/1255/comments","events_url":"https://api.github.com/repos/chrisaljoudi/uBlock/issues/1255/events","html_url":"https://github.com/chrisaljoudi/uBlock/issues/1255","id":68431470,"number":1255,"title":"per filter base script src replacement","user":{"login":"xuefer","id":1741312,"avatar_url":"https://avatars.githubusercontent.com/u/1741312?v=3","gravatar_id":"","url":"https://api.github.com/users/xuefer","html_url":"https://github.com/xuefer","followers_url":"https://api.github.com/users/xuefer/followers","following_url":"https://api.github.com/users/xuefer/following{/other_user}","gists_url":"https://api.github.com/users/xuefer/gists{/gist_id}","starred_url":"https://api.github.com/users/xuefer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xuefer/subscriptions","organizations_url":"https://api.github.com/users/xuefer/orgs","repos_url":"https://api.github.com/users/xuefer/repos","events_url":"https://api.github.com/users/xuefer/events{/privacy}","received_events_url":"https://api.github.com/users/xuefer/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/chrisaljoudi/uBlock/labels/Suggestion","name":"Suggestion","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-04-14T16:26:49Z","updated_at":"2015-04-16T08:17:16Z","closed_at":null,"body":"I'd like to replace some bad/evil/ad script src to alternative or dummy one with dummy functions\r\nblocking them works most of the time but in some website other part of the script rely on this script"},"comment":{"url":"https://api.github.com/repos/chrisaljoudi/uBlock/issues/comments/93674308","html_url":"https://github.com/chrisaljoudi/uBlock/issues/1255#issuecomment-93674308","issue_url":"https://api.github.com/repos/chrisaljoudi/uBlock/issues/1255","id":93674308,"user":{"login":"lewisje","id":4865237,"avatar_url":"https://avatars.githubusercontent.com/u/4865237?v=3","gravatar_id":"","url":"https://api.github.com/users/lewisje","html_url":"https://github.com/lewisje","followers_url":"https://api.github.com/users/lewisje/followers","following_url":"https://api.github.com/users/lewisje/following{/other_user}","gists_url":"https://api.github.com/users/lewisje/gists{/gist_id}","starred_url":"https://api.github.com/users/lewisje/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lewisje/subscriptions","organizations_url":"https://api.github.com/users/lewisje/orgs","repos_url":"https://api.github.com/users/lewisje/repos","events_url":"https://api.github.com/users/lewisje/events{/privacy}","received_events_url":"https://api.github.com/users/lewisje/received_events","type":"User","site_admin":false},"created_at":"2015-04-16T08:17:16Z","updated_at":"2015-04-16T08:17:16Z","body":"Maybe a combination of uBlock and a UserScript would work: Block the original script and supply your own with the dummy functions.\r\n\r\nWith that said, I can imagine a (highly brittle) syntax extension, something like `$surrogate=name` where `name` is the name that you have given to a surrogate script to be delivered instead of the blocked script (and then there would need to be some section where you store surrogate scripts, and maybe some way to deal with potentially multiple surrogates being sent because multiple filters were matched); I know at least in Chrome, the webRequest API allows for redirecting rather than cancelling the request, although I remember when gorhill tried something similar (redirecting to minimal content, like 1x1 transparent PNGs and empty HTML documents), it didn't play nice with HTTPS Everywhere and he dropped the idea: https://github.com/chrisaljoudi/uBlock/issues/18\r\n\r\nHowever, maybe this is just out of scope for the extension, because we'd basically be re-creating TamperMonkey here."}}