+'use strict';
+
var EventEmitter, Menu, NavigationController, PDFPageSize, binding, deprecate, getNextId, ipcMain, nextId, ref, session, wrapWebContents,
slice = [].slice;
}
};
+// Following methods are mapped to webFrame.
+const webFrameMethods = [
+ 'insertText',
+];
+
wrapWebContents = function(webContents) {
/* webContents is an EventEmitter. */
}
}
+ // Mapping webFrame methods.
+ for (let method of webFrameMethods) {
+ webContents[method] = function() {
+ let args = Array.prototype.slice.call(arguments);
+ this.send('ELECTRON_INTERNAL_RENDERER_WEB_FRAME_METHOD', method, args);
+ };
+ }
+
/* Dispatch IPC messages to the ipc module. */
webContents.on('ipc-message', function(event, packed) {
var args, channel;
+'user strict';
+
var Module, arg, error, error1, events, globalPaths, i, len, nodeIntegration, path, pathname, preloadScript, ref, url, v8Util;
events = require('events');
v8Util.setHiddenValue(global, 'ipc', new events.EventEmitter);
+// Use electron module after everything is ready.
+const electron = require('electron');
+
+// Call webFrame method.
+electron.ipcRenderer.on('ELECTRON_INTERNAL_RENDERER_WEB_FRAME_METHOD', (event, method, args) => {
+ electron.webFrame[method].apply(electron.webFrame, args);
+});
/* Process command line arguments. */
/* Public-facing API methods. */
methods = ['getURL', 'getTitle', 'isLoading', 'isWaitingForResponse', 'stop', 'reload', 'reloadIgnoringCache', 'canGoBack', 'canGoForward', 'canGoToOffset', 'clearHistory', 'goBack', 'goForward', 'goToIndex', 'goToOffset', 'isCrashed', 'setUserAgent', 'getUserAgent', 'openDevTools', 'closeDevTools', 'isDevToolsOpened', 'isDevToolsFocused', 'inspectElement', 'setAudioMuted', 'isAudioMuted', 'undo', 'redo', 'cut', 'copy', 'paste', 'pasteAndMatchStyle', 'delete', 'selectAll', 'unselect', 'replace', 'replaceMisspelling', 'findInPage', 'stopFindInPage', 'getId', 'downloadURL', 'inspectServiceWorker', 'print', 'printToPDF'];
- nonblockMethods = ['send', 'sendInputEvent', 'executeJavaScript', 'insertCSS'];
+ nonblockMethods = [
+ 'executeJavaScript',
+ 'insertCSS',
+ 'insertText',
+ 'send',
+ 'sendInputEvent',
+ ];
/* Forward proto.foo* method calls to WebViewImpl.foo*. */
createBlockHandler = function(m) {
Executes the editing command `replaceMisspelling` in web page.
+### `webContents.insertText(text)`
+
+* `text` String
+
+Inserts `text` to the focused element.
+
### `webContents.findInPage(text[, options])`
* `text` String - Content to be searched, must not be empty.
* `text` String
-* Inserts `text` to the focused element.
+Inserts `text` to the focused element.
[spellchecker]: https://github.com/atom/node-spellchecker
Executes editing command `replaceMisspelling` in page.
+### `<webview>.insertText(text)`
+
+* `text` String
+
+Inserts `text` to the focused element.
+
### `<webview>.findInPage(text[, options])`
* `text` String - Content to be searched, must not be empty.