Add insertText to WebContents

This commit is contained in:
Cheng Zhao 2016-01-13 11:55:49 +08:00
parent 5567baf335
commit 5b7d1a9890
6 changed files with 44 additions and 2 deletions

View file

@ -1,3 +1,5 @@
'user strict';
var Module, arg, error, error1, events, globalPaths, i, len, nodeIntegration, path, pathname, preloadScript, ref, url, v8Util;
events = require('events');
@ -44,6 +46,13 @@ v8Util = process.atomBinding('v8_util');
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. */

View file

@ -376,7 +376,13 @@ registerWebViewElement = function() {
/* 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) {