File tree 1 file changed +11
-3
lines changed
1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -25,9 +25,17 @@ chrome.webRequest.onHeadersReceived.addListener(
25
25
26
26
chrome . webRequest . onBeforeRequest . addListener (
27
27
function ( details ) {
28
- if ( tabinfo . get ( details . tabId ) ) {
29
- return details . url ;
30
- }
28
+ // Comment out these lines
29
+ // The returned data is NOT a webRequest.BlockingResponse type data, will cause error on Chrome Version 87 88 90
30
+ // see https://github.com/justjavac/ReplaceGoogleCDN/issues/64#issuecomment-839610913
31
+ // see https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webRequest/onBeforeRequest
32
+
33
+ // If we need to deal with the CSP, we must return the right data type but not simple a url string.
34
+
35
+ // if (tabinfo.get(details.tabId)) {
36
+ // return details.url;
37
+ // }
38
+
31
39
let url = details . url . replace ( 'http://' , 'https://' )
32
40
url = url . replace ( 'ajax.googleapis.com' , 'ajax.loli.net' ) ;
33
41
url = url . replace ( 'fonts.googleapis.com' , 'fonts.loli.net' ) ;
You can’t perform that action at this time.
0 commit comments