From 1815f8b40d1f5e84c62d68555fbb383dd7261b08 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 25 Apr 2014 13:14:11 +0800 Subject: [PATCH] Make send and loadUrl also supported methods of BrowserWindow. --- atom/browser/api/lib/browser-window.coffee | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/atom/browser/api/lib/browser-window.coffee b/atom/browser/api/lib/browser-window.coffee index df2c5393d..746d18167 100644 --- a/atom/browser/api/lib/browser-window.coffee +++ b/atom/browser/api/lib/browser-window.coffee @@ -87,8 +87,11 @@ BrowserWindow.fromDevTools = (processId, routingId) -> return window if devtools.processId == processId and devtools.routingId == routingId +# Helpers. +BrowserWindow::loadUrl = -> @webContents.loadUrl.apply @webContents, arguments +BrowserWindow::send = -> @webContents.send.apply @webContents, arguments + # Be compatible with old API. -BrowserWindow::loadUrl = (url) -> @webContents.loadUrl(url) BrowserWindow::getUrl = -> @webContents.getUrl() BrowserWindow::reload = -> @webContents.reload() BrowserWindow::reloadIgnoringCache = -> @webContents.reloadIgnoringCache()