Opened on 04/22/2015 at 12:48:05 PM
Closed on 11/06/2015 at 02:50:30 PM
Last modified on 04/25/2016 at 02:21:48 AM
#2396 closed change (fixed)
Add code for CSS property filters to message responder
Reported by: | trev | Assignee: | kzar |
---|---|---|---|
Priority: | P2 | Milestone: | |
Module: | User-Interface | Keywords: | |
Cc: | sebastian | Blocked By: | |
Blocking: | #2388, #2392, #2395, #2397, #2401 | Platform: | Unknown |
Ready: | yes | Confidential: | no |
Tester: | Ross | Verified working: | yes |
Review URL(s): |
Description (last modified by kzar)
Background
The content script created in #2395 will have to request CSS property filters from the background page. There is currently no message for that.
What to change
Add a filters.get message to messageResponder.js in the adblockplusui repository. When received with what: "cssproperties" it should query CSSRules container for matching filters and respond with a list like [{prefix: "foo > ", suffix: "", regexp: "background-image: .*"} and {prefix: "", suffix " > bar", regexp: "margin-left: -50px"}]. The list should be filters that apply to the current domain, see sender.frame.url.
Attachments (0)
Change History (12)
comment:1 Changed on 04/22/2015 at 12:52:38 PM by trev
- Blocking 2397 added
comment:2 Changed on 04/22/2015 at 01:10:04 PM by trev
- Blocking 2401 added
comment:3 Changed on 04/22/2015 at 01:19:58 PM by sebastian
comment:4 Changed on 04/22/2015 at 01:25:26 PM by trev
Arguably, the message responder is there to support UI code. The main question is whether content scripts are UI - looking at Chrome's content scripts they probably can be considered as such.
comment:5 Changed on 04/22/2015 at 01:49:20 PM by sebastian
I wouldn't consider any of our content scripts UI, as they mainly support adblocking functionality, and well the "Block element" functionality on Chrome, but not even it's UI but only the logic to select and highlight elements.
comment:6 Changed on 04/28/2015 at 04:32:22 PM by sebastian
Does the content script actually have to send the domain? Usually we retrieve the domain with extractHostnameFromFrame(sender.frame) in the background page.
comment:7 Changed on 04/28/2015 at 05:47:27 PM by trev
You don't have to send the domain, but sharing the message responder will become rather complicated then - you need to expose some API for the browser-specific processing of the URL.
comment:8 Changed on 11/02/2015 at 12:36:05 PM by kzar
- Owner set to kzar
- Tester set to Unknown
comment:9 Changed on 11/03/2015 at 10:20:25 AM by kzar
- Review URL(s) modified (diff)
- Status changed from new to reviewing
comment:10 Changed on 11/05/2015 at 02:34:37 PM by kzar
- Description modified (diff)
comment:11 Changed on 11/06/2015 at 02:50:30 PM by kzar
- Blocked By 2392, 2395 removed
- Blocking 2392, 2395 added
- Resolution set to fixed
- Status changed from reviewing to closed
comment:12 Changed on 04/25/2016 at 02:21:48 AM by Ross
- Tester changed from Unknown to Ross
- Verified working set
CSS property filters are in the build and working.
(Followed from #3813).
ABP 2.7.2.4166
Firefox 38 / 44 / Windows 8
Nightly 48.0a1 (2016-04-19) / Windows 8
Firefox 38 / 44 / OS X 10.11
Firefox 45.01 / Ubuntu 14.04
Nightly 48.0a1 (2016-04-19) / Ubuntu 14.04
So far for separating backend logic from UI code. I think the the common logic here should rather belong into the core code. Hence the messaging code should be fairly trivial and implemented directly in the individual extensions.