Opened on 09/15/2017 at 12:49:38 PM

Closed on 09/20/2017 at 09:25:25 AM

Last modified on 01/26/2018 at 11:03:01 AM

#5695 closed change (fixed)

Check for extensionTypes.CSSOrigin to determine if user style sheets are supported

Reported by: mjethani Assignee: mjethani
Priority: P3 Milestone: Adblock-Plus-3.0-for-Firefox
Module: Platform Keywords:
Cc: sebastian, trev, kzar, Ross Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

https://codereview.adblockplus.org/29545645/

Description (last modified by sebastian)

Background

Currently lib/cssInjection.js in adblockpluschrome calls the tabs.insertCSS API at least once and decides that user style sheets are not supported only if the function call fails accordingly.

A better approach is to check for CSSOrigin in extensionTypes, as this involves less (complicated) code, and avoids a first attempt to use insertCSS() on browsers that don't support cssOrigin.

What to change

In lib/cssInjection.js, check for "CSSOrigin" in chrome.extensionTypes to determine if user style sheets are supported. Remove try...catch from hideElements and make it just a function call; do not return any value. Make changes to the calling code in the same file accordingly.

Hints for testers

Same as #5090, also see comment 24 and 25.

Attachments (0)

Change History (5)

comment:1 Changed on 09/15/2017 at 06:33:47 PM by sebastian

  • Description modified (diff)
  • Priority changed from Unknown to P3
  • Ready set

comment:2 Changed on 09/20/2017 at 09:18:43 AM by abpbot

A commit referencing this issue has landed:
Issue 5695 - Use tabs.insertCSS if extensionTypes.CSSOrigin exists

comment:3 Changed on 09/20/2017 at 09:25:25 AM by mjethani

  • Milestone set to Adblock-Plus-for-Chrome-Opera-next
  • Resolution set to fixed
  • Review URL(s) modified (diff)
  • Status changed from new to closed

comment:4 Changed on 01/25/2018 at 04:21:24 PM by abpbot

A commit referencing this issue has landed:
Issue 5695 - Use tabs.insertCSS if extensionTypes.CSSOrigin exists

comment:5 Changed on 01/26/2018 at 10:39:53 AM by sebastian

  • Cc kzar Ross added

For reference, this change was included in Adblock Plus 3.0 for Firefox, and will be the only change included in Adblock Plus 1.13.5 for Chrome/Opera.

While the way we did feature detection as of Adblock Plus 1.13.4 causes user stylsheets already being used on Chrome >=66 (currently Canary), the way the feature detection was changed here, user stylesheets are only used on Firefox (due to the lack of chrome.extensionTypes on Chrome). While we eventually want to use user stylesheets on Chrome too, it currently causes pages to be rendered blank.

Last edited on 01/26/2018 at 11:03:01 AM by sebastian

Add Comment

Modify Ticket

Change Properties
Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from mjethani.
 
Note: See TracTickets for help on using tickets.