Opened 2 months ago

Closed 2 months ago

#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-Chrome-Opera-Firefox
Module: Platform Keywords:
Cc: sebastian, trev Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

Description (last modified by sebastian)


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.

Change History (3)

comment:1 Changed 2 months ago by sebastian

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

comment:2 Changed 2 months ago by abpbot

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

comment:3 Changed 2 months ago 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
Note: See TracTickets for help on using tickets.