Merge pull request #2 from mykmelez/fix-webview

disable wrapping of WebContents by NavigationController
This commit is contained in:
Myk Melez 2016-10-06 15:59:43 -07:00 коммит произвёл GitHub
Родитель 11f3838196 c528072515
Коммит 3345aa05f8
1 изменённых файлов: 21 добавлений и 12 удалений

Просмотреть файл

@ -81,18 +81,27 @@ let wrapWebContents = function(webContents) {
};
// The navigation controller.
controller = new NavigationController(webContents);
ref1 = NavigationController.prototype;
for (name in ref1) {
method = ref1[name];
if (method instanceof Function) {
(function(name, method) {
return webContents[name] = function() {
return method.apply(controller, arguments);
};
})(name, method);
}
}
//
// mozbrowserlocationchange doesn't provide the inPage and replaceEntry
// metadata that would be required for NavigationController to "compeletely do
// history control on user land" (as navigation-controller.js describes it).
//
// So we disable the wrapping of WebContents by NavigationController
// and then implement methods that are unique to NavigationController
// over in atom_browser_web_contents.js.
//
// controller = new NavigationController(webContents);
// ref1 = NavigationController.prototype;
// for (name in ref1) {
// method = ref1[name];
// if (method instanceof Function) {
// (function(name, method) {
// return webContents[name] = function() {
// return method.apply(controller, arguments);
// };
// })(name, method);
// }
// }
// Mapping webFrame methods.
for (let method of webFrameMethods) {