File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 11import path from 'path' ;
2- import { app } from 'electron' ;
2+ import { app , protocol , net } from 'electron' ;
33
44/**
55 * All these variables below are used by Compass and its plugins in one way or
5454 // seemingly nothing is using this path anyway, we probably can ignore an
5555 // error here
5656 app . setPath ( 'userCache' , path . join ( app . getPath ( 'cache' ) , app . getName ( ) ) ) ;
57+
58+ // TODO(COMPASS-8269): even with `webSecurity` disabled for local dev,
59+ // file:// requests for shell worker are silently getting canceled by the
60+ // browser, adding explicit protocol handler for it that just does the same
61+ // request using electron network stack works around the issue
62+ void app . whenReady ( ) . then ( ( ) => {
63+ protocol . handle ( 'file' , ( req ) => {
64+ return net . fetch ( req , { bypassCustomProtocolHandlers : true } ) ;
65+ } ) ;
66+ } ) ;
5767 }
5868
5969 app . setPath (
You can’t perform that action at this time.
0 commit comments