Changes between Initial Version and Version 6 of Ticket #5090


Ignore:
Timestamp:
04/03/2017 12:28:01 PM (3 years ago)
Author:
sebastian
Comment:

I guess, that should do for now. (We might have to revisit this though, once Chrome catches up, as they plan to use user stylesheet, without additional parameter, no matter what.)

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #5090

    • Property Cc sebastian greiner added
    • Property Priority changed from Unknown to P2
    • Property Ready set
  • Ticket #5090 – Description

    initial v6  
    33 
    44=== What to change === 
    5 Add a special code path when responding to `get-selectors` message - on Firefox 53 and higher no selectors should be returned, instead `chrome.tabs.insertCSS` should be called. 
     5 
     6When a content script sends a `get-selectors` message , try injecting the stylesheet from the backround page using `tabs.insertCSS({..., cssOrigin: "user})`. If it fails because `cssOrigin` isn't supported (i.e. on Firefox <53 and every other browser currently) remember that condition and don't try again. 
     7 
     8If the stylesheet was injected by `insertCSS()` and no devtools panel is active for the same tab, send following response: 
     9 
     10{{{ 
     11{ 
     12  inject: false, 
     13  trace: false 
     14} 
     15}}} 
     16 
     17If the stylesheet was injected by `insertCSS()` and there is an active devtools panel for the same tab, send following response: 
     18 
     19{{{ 
     20{ 
     21  inject: false, 
     22  trace: true, 
     23  selectors: [...] 
     24} 
     25}}} 
     26 
     27If `insertCSS()` doesn't support `cssOrigin`, set `inject` to `true` and always include the `selectors`, regardless whether the devtools panel is active: 
     28 
     29{{{ 
     30{ 
     31  inject: true, 
     32  trace: ..., 
     33  selectors: [...] 
     34} 
     35}}} 
     36 
     37Adapt the content script, in order to handle the `inject` key, so no stlesheet is injected when it is `false`.