Changes between Version 4 and Version 5 of Ticket #7384


Ignore:
Timestamp:
03/20/2019 12:48:16 PM (17 months ago)
Author:
kzar
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #7384 – Description

    v4 v5  
    33 
    44=== What to change === 
    5 If `browser.webRequest.ResourceType` isn't defined, attempt to create a listener for the `browser.webRequest.onBeforeRequest` event with an invalid resource type filter. Then attempt to obtain the list of valid resource types from the exception's message. 
     5- If `browser.webRequest.ResourceType` isn't defined, attempt to create a listener for the `browser.webRequest.onBeforeRequest` event with an invalid resource type filter. Then attempt to obtain the list of valid resource types from the exception's message. 
    66 
    77For example: 
     
    1717}}} 
    1818 
    19 For reference - no need to handle this - the exception looks like this on Chrome 72.0.3626.119: 
     19- Modify any code which assumes `browser.webRequest.ResourceType` doesn't exist on Edge, for example in adblockpluschrome/lib/requestBlocker.js.'' 
    2020 
    21 {{{ 
    22 Error at parameter 'filter': Error at property 'types': Error at index 0: Value must be one of csp_report, font, image, main_frame, media, object, other, ping, script, stylesheet, sub_frame, websocket, xmlhttprequest. 
    23 }}} 
     21- Modify webRequest listeners (e.g. in adblockpluschrome/ext/background.js) that we've so far avoided passing the types filter for, to use that instead of manually checking the event's `type` property. 
    2422 
    25 and this one Firefox 64.0: 
    26  
    27 {{{ 
    28 Type error for parameter filter (Error processing types.0: Invalid enumeration value "foo") for webRequest.onBeforeRequest. 
    29 }}} 
    30  
    31 ''Note: You'll also need to modify any code which assumes `browser.webRequest.ResourceType` doesn't exist on Edge, for example in adblockpluschrome/lib/requestBlocker.js.'' 
     23=== Notes === 
     24- Edge seems to provide the exception as a String, where as the other browsers provide it as an Object which contains a `message` property which references the String. 
     25- No need to handle them, but here's how the exception message looks on 
     26  - Chrome 72.0.3626.119: `Error at parameter 'filter': Error at property 'types': Error at index 0: Value must be one of csp_report, font, image, main_frame, media, object, other, ping, script, stylesheet, sub_frame, websocket, xmlhttprequest.` 
     27  - Firefox 64.0: `Type error for parameter filter (Error processing types.0: Invalid enumeration value "foo") for webRequest.onBeforeRequest.`