parent
6e069a7df8
commit
d9d07c65b2
3 changed files with 23 additions and 33 deletions
22
lib/browser/api/net-log.ts
Normal file
22
lib/browser/api/net-log.ts
Normal file
|
@ -0,0 +1,22 @@
|
|||
// TODO(deepak1556): Deprecate and remove standalone netLog module,
|
||||
// it is now a property of session module.
|
||||
import { app, session } from 'electron';
|
||||
|
||||
const startLogging: typeof session.defaultSession.netLog.startLogging = async (path, options) => {
|
||||
if (!app.isReady()) return;
|
||||
return session.defaultSession.netLog.startLogging(path, options);
|
||||
};
|
||||
|
||||
const stopLogging: typeof session.defaultSession.netLog.stopLogging = async () => {
|
||||
if (!app.isReady()) return;
|
||||
return session.defaultSession.netLog.stopLogging();
|
||||
};
|
||||
|
||||
export default {
|
||||
startLogging,
|
||||
stopLogging,
|
||||
get currentlyLogging (): boolean {
|
||||
if (!app.isReady()) return false;
|
||||
return session.defaultSession.netLog.currentlyLogging;
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue