Opened on 04/16/2014 at 11:42:14 PM
Closed on 04/28/2014 at 06:37:28 PM
#345 closed change (rejected)
[Chrome, Opera, Safari?] Replace blocked images and documents with minimal valid content.
Reported by: | lewisje | Assignee: | |
---|---|---|---|
Priority: | Unknown | Milestone: | |
Module: | Platform | Keywords: | |
Cc: | smultron45@gmail.com, trev | Blocked By: | |
Blocking: | Platform: | ||
Ready: | no | Confidential: | no |
Tester: | Verified working: | no | |
Review URL(s): |
Description
Background
This will reduce the incidence of "blocked by an extension" messages in the browser and error messages in the console and promote a cleaner layout in pages in which content is blocked but the corresponding elements are not hidden.
What to Change
For blocked images, instead of cancelling the request, redirect to the same 67-byte 1x1px transparent PNG that was used in the old developer versions of Adblock Plus that tested out the WebRequest API and is now used by AdBlock, ScriptSafe, and Ghostery:
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==
For blocked (X)HTML documents, instead of cancelling the request, redirect to about:blank; this and the above action are what the old WebRequest developer versions of Adblock Plus did and what AdBlock for Chrome and Opera still does (I haven't checked whether it does this on Safari, but if so it would be nice to copy its approach).
Other Possibilities
Other possibilities include replacing blocked XHRs with "data:application/xml," and blocked stylesheets with "data:text/css," and blocked scripts with "data:application/javascript," (including the commas) but the primary effect will be to reduce errors in the console; although I have mentioned many more possibilities here, they aren't such a high priority: https://adblockplus.org/forum/viewtopic.php?t=18911
Future Developments
If it is possible to do something similar on other platforms (I've only investigated WebRequest, not nsIContentPolicy or anything on Safari, IE, or Android), this would be an improvement there too; also, if declarativeWebRequest becomes available in Chrome Stable, it might become more elegant to redirect to either a blank image or a blank document, because that API has built-in methods for such redirects.
Attachments (0)
Change History (5)
comment:1 Changed on 04/17/2014 at 06:44:57 AM by mapx
- Cc smultron45@gmail.com added
comment:2 Changed on 04/17/2014 at 05:58:01 PM by trev
- Cc trev added
comment:3 Changed on 04/17/2014 at 05:59:31 PM by trev
comment:4 Changed on 04/28/2014 at 04:25:10 PM by philll
@trev: So can we close this issue for now?
comment:5 Changed on 04/28/2014 at 06:37:28 PM by trev
- Resolution set to rejected
- Status changed from new to closed
Yes, closing. If you have specific scenarios where we don't collapse blocked content - please file issues for them.
The problem with redirecting via WebRequest API is the conflicts with other extensions - if two extensions decide to redirect and use different URLs for that (a likely scenario) then Chrome will show a scary error message. As things are now, Chrome has no proper way of resolving these conflicts.
IMHO we should rather invest some time into fixing the scenarios where collapsing blocked elements doesn't work.