5.2 KiB
5.2 KiB
Promisification
The Electron team recently underwent an initiative to convert callback-based APIs to Promise-based ones. See converted functions below:
- app.getFileIcon(path[, options], callback)
- contents.capturePage([rect, ]callback)
- contents.executeJavaScript(code[, userGesture, callback])
- contents.printToPDF(options, callback)
- contents.savePage(fullPath, saveType, callback)
- contentTracing.getCategories(callback)
- contentTracing.startRecording(options, callback)
- contentTracing.stopRecording(resultFilePath, callback)
- contentTracing.getTraceBufferUsage(callback)
- cookies.flushStore(callback)
- cookies.get(filter, callback)
- cookies.remove(url, name, callback)
- cookies.set(details, callback)
- debugger.sendCommand(method[, commandParams, callback])
- desktopCapturer.getSources(options, callback)
- dialog.showOpenDialog([browserWindow, ]options[, callback])
- dialog.showSaveDialog([browserWindow, ]options[, callback])
- inAppPurchase.purchaseProduct(productID, quantity, callback)
- inAppPurchase.getProducts(productIDs, callback)
- dialog.showMessageBox([browserWindow, ]options[, callback])
- dialog.showCertificateTrustDialog([browserWindow, ]options, callback)
- netLog.stopLogging([callback])
- protocol.isProtocolHandled(scheme, callback)
- ses.clearHostResolverCache([callback])
- ses.clearStorageData([options, callback])
- ses.setProxy(config, callback)
- ses.resolveProxy(url, callback)
- ses.getCacheSize(callback)
- ses.clearAuthCache(options[, callback])
- ses.clearCache(callback)
- ses.getBlobData(identifier, callback)
- shell.openExternal(url[, options, callback])
- webFrame.executeJavaScript(code[, userGesture, callback])
- webFrame.executeJavaScriptInIsolatedWorld(worldId, scripts[, userGesture, callback])
- webviewTag.capturePage([rect, ]callback)
- webviewTag.executeJavaScript(code[, userGesture, callback])
- webviewTag.printToPDF(options, callback)
- win.capturePage([rect, ]callback)