Skip to content

Commit 57878c5

Browse files
fix(overmind-devtools): temp fix for electron bug
1 parent c295561 commit 57878c5

File tree

1 file changed

+17
-0
lines changed
  • packages/node_modules/overmind-devtools/src

1 file changed

+17
-0
lines changed

packages/node_modules/overmind-devtools/src/main.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,26 @@ function createWindow() {
168168
)
169169

170170
startDevtoolBackend().then(openDevtools)
171+
172+
/*
173+
BUG FIX: https://github.com/electron/electron/issues/13008#issuecomment-575909942
174+
*/
175+
let redirectURL = 'data:application/x-javascript;base64,UHJvZHVjdFJlZ2lzdHJ5SW1wbC5SZWdpc3RyeT1jbGFzc3tjb25zdHJ1Y3Rvcigpe31uYW1lRm9yVXJsKHIpe3JldHVybiBudWxsfWVudHJ5Rm9yVXJsKHIpe3JldHVybiBudWxsfXR5cGVGb3JVcmwocil7cmV0dXJuIG51bGx9fSxQcm9kdWN0UmVnaXN0cnlJbXBsLl9oYXNoRm9yRG9tYWluPWZ1bmN0aW9uKHIpe3JldHVybiIifSxQcm9kdWN0UmVnaXN0cnlJbXBsLnJlZ2lzdGVyPWZ1bmN0aW9uKHIsdCl7UHJvZHVjdFJlZ2lzdHJ5SW1wbC5fcHJvZHVjdHNCeURvbWFpbkhhc2g9bmV3IE1hcH0sUHJvZHVjdFJlZ2lzdHJ5SW1wbC5fcHJvZHVjdHNCeURvbWFpbkhhc2g9bmV3IE1hcCxQcm9kdWN0UmVnaXN0cnlJbXBsLnJlZ2lzdGVyKFtdLFtdKSxQcm9kdWN0UmVnaXN0cnlJbXBsLnNoYTE9ZnVuY3Rpb24ocil7cmV0dXJuIiJ9Ow==';
176+
electron.session.defaultSession.webRequest.onBeforeRequest((details, callback) => {
177+
if ((/^devtools:\/\/devtools\/remote\/serve_file\/@[0-9a-f]{40}\/product_registry_impl\/product_registry_impl_module.js$/ui).test(details.url)) {
178+
// eslint-disable-next-line
179+
callback({
180+
redirectURL
181+
});
182+
return;
183+
}
184+
// eslint-disable-next-line
185+
callback({});
186+
});
171187
}
172188

173189
// This method will be called when Electron has finished
174190
// initialization and is ready to create browser windows.
175191
// Some APIs can only be used after this event occurs.
176192
app.on('ready', createWindow)
193+

0 commit comments

Comments
 (0)