-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Closed as not planned
Closed as not planned
Copy link
Description
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for a bug report that matches the one I want to file, without success.
Electron Version
25.1.1
What operating system are you using?
Ubuntu
Operating System Version
18.04
What arch are you using?
x64
Last Known Working Electron version
No response
Expected Behavior
The following minimal example:
const {app, BrowserWindow, protocol, session} = require('electron');
protocol.registerSchemesAsPrivileged([{
scheme: 'yolo',
privileges: {
standard: true,
secure: true,
bypassCSP: true,
supportFetchAPI: true
}
}]);
app.whenReady().then(async () => {
protocol.registerFileProtocol('yolo', (request, callback) => {
console.log('FILE CALLBACK');
console.log(request.url);
callback({url: request.url});
});
let win = new BrowserWindow({
webPreferences: {
nodeIntegration: true,
nodeIntegrationInSubFrames: false,
contextIsolation: false,
},
});
session.defaultSession.webRequest.onBeforeRequest((details, callback) => {
console.log('BEFORE REQUEST');
console.log(details.url);
callback({});
});
win.loadURL('yolo://localhost:8000/asdf.html');
});
is expected to print:
BEFORE REQUEST
yolo://localhost:8000/asdf.html
FILE CALLBACK
yolo://localhost:8000/asdf.html
Actual Behavior
Instead, it prints
BEFORE REQUEST
yolo://localhost/asdf.html
FILE CALLBACK
yolo://localhost/asdf.html
(the port is stripped)
Testcase Gist URL
No response
Additional Information
No response