Skip to content

Instantly share code, notes, and snippets.

@kechol
Last active March 21, 2018 11:09
Show Gist options
  • Save kechol/7b2a5406db6101bc29d2d8bfd8d622cd to your computer and use it in GitHub Desktop.
Save kechol/7b2a5406db6101bc29d2d8bfd8d622cd to your computer and use it in GitHub Desktop.
http://localhost:4000/index.html did-start-loading
http://localhost:4000/index.html did-get-response-details false http://localhost:4000/index.html http://localhost:4000/index.html 200 GET mainFrame
http://localhost:4000/index.html did-navigate http://localhost:4000/index.html
http://localhost:4000/index.html did-get-response-details false https://unpkg.com/[email protected]/normalize.css https://unpkg.com/[email protected]/normalize.css 200 GET stylesheet
http://localhost:4000/index.html did-get-response-details false https://unpkg.com/[email protected]/dist/jquery.js https://unpkg.com/[email protected]/dist/jquery.js 200 GET script
http://localhost:4000/index.html dom-ready
http://localhost:4000/index.html console-message 1 %cElectron Security Warning (Node.js Integration with Remote Content) 145
http://localhost:4000/index.html console-message 1 %cElectron Security Warning (Insecure Resources) 128
http://localhost:4000/index.html console-message 1 %cElectron Security Warning (Insecure Content-Security-Policy) 188
http://localhost:4000/index.html did-frame-finish-load true
http://localhost:4000/index.html did-finish-load
http://localhost:4000/index.html page-favicon-updated [ 'http://localhost:4000/favicon.ico' ]
http://localhost:4000/index.html did-stop-loading
const getWebpage = (webpageUrl: string) => (new Promise((_resolve, _reject) => {
window.webContents.once('did-finish-load', () => {
console.log(webpageUrl, 'did-finish-load');
});
window.webContents.once('did-fail-load', (_e, errorCode, errorDescription, validatedUrl) => {
console.log(webpageUrl, 'did-fail-load', errorCode, errorDescription, validatedUrl);
});
window.webContents.once('did-frame-finish-load', (_e, isMainFrame) => {
console.log(webpageUrl, 'did-frame-finish-load', isMainFrame);
});
window.webContents.once('did-start-loading', () => {
console.log(webpageUrl, 'did-start-loading');
});
window.webContents.once('did-stop-loading', () => {
console.log(webpageUrl, 'did-stop-loading');
});
window.webContents.once('did-get-response-details', (_e, status, newUrl, originalUrl, responseCode, requestMethod, _referrer, _headers, resourceType) => {
console.log(webpageUrl, 'did-get-response-details', status, newUrl, originalUrl, responseCode, requestMethod, resourceType);
});
window.webContents.once('did-get-redirect-request', (_e, oldUrl, newUrl, isMainFrame, responseCode, requestMethod, _referrer, _headers) => {
console.log(webpageUrl, 'did-get-redirect-request', oldUrl, newUrl, isMainFrame, responseCode, requestMethod);
});
window.webContents.once('dom-ready', (_e) => {
console.log(webpageUrl, 'dom-ready');
});
window.webContents.once('page-favicon-updated', (_e, fav) => {
console.log(webpageUrl, 'page-favicon-updated', fav);
});
window.webContents.once('new-window', (_e, currentUrl, frameName, disposition, options, features) => {
console.log(webpageUrl, 'new-window', currentUrl, frameName, disposition, options, features);
});
window.webContents.once('will-navigate', (_e, currentUrl) => {
console.log(webpageUrl, 'will-navigate', currentUrl);
});
window.webContents.once('did-navigate', (_e, currentUrl) => {
console.log(webpageUrl, 'did-navigate', currentUrl);
});
window.webContents.once('did-navigate-in-page', (_e, currentUrl, inMainFrame) => {
console.log(webpageUrl, 'did-navigate-in-page', currentUrl, inMainFrame);
});
window.webContents.once('will-prevent-unload', (_e) => {
console.log(webpageUrl, 'will-prevent-unload');
});
window.webContents.once('crashed', (_e, killed) => {
console.log(webpageUrl, 'crashed', killed);
});
window.webContents.once('destroyed', () => {
console.log(webpageUrl, 'destroyed');
});
window.webContents.once('console-message', (_e, level, message, line) => {
console.log(webpageUrl, 'console-message', level, message, line);
});
window.loadURL(webpageUrl);
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment