Replace "Url" in API names with "URL"

This commit is contained in:
Cheng Zhao 2015-11-13 16:03:40 +08:00
parent 8f56387bd9
commit fbb8e61958
57 changed files with 251 additions and 212 deletions

View file

@ -81,7 +81,7 @@ void AutoUpdater::OnWindowAllClosed() {
mate::ObjectTemplateBuilder AutoUpdater::GetObjectTemplateBuilder(
v8::Isolate* isolate) {
return mate::ObjectTemplateBuilder(isolate)
.SetMethod("setFeedUrl", &auto_updater::AutoUpdater::SetFeedURL)
.SetMethod("setFeedURL", &auto_updater::AutoUpdater::SetFeedURL)
.SetMethod("checkForUpdates", &auto_updater::AutoUpdater::CheckForUpdates)
.SetMethod("quitAndInstall", &AutoUpdater::QuitAndInstall);
}

View file

@ -204,7 +204,7 @@ void Cookies::GetCookiesOnIOThread(scoped_ptr<base::DictionaryValue> filter,
Passed(&filter), callback))) {
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
base::Bind(&RunGetCookiesCallbackOnUIThread, isolate(),
"Url is not valid", net::CookieList(), callback));
"URL is not valid", net::CookieList(), callback));
}
}
@ -229,7 +229,7 @@ void Cookies::Remove(const mate::Dictionary& details,
error_message = "Details(url, name) of removing cookie are required.";
}
if (error_message.empty() && !url.is_valid()) {
error_message = "Url is not valid.";
error_message = "URL is not valid.";
}
if (!error_message.empty()) {
RunRemoveCookiesCallbackOnUIThread(isolate(), error_message, callback);
@ -261,7 +261,7 @@ void Cookies::Set(const base::DictionaryValue& options,
GURL gurl(url);
if (error_message.empty() && !gurl.is_valid()) {
error_message = "Url is not valid.";
error_message = "URL is not valid.";
}
if (!error_message.empty()) {

View file

@ -103,7 +103,7 @@ int64 DownloadItem::GetTotalBytes() {
return download_item_->GetTotalBytes();
}
const GURL& DownloadItem::GetUrl() {
const GURL& DownloadItem::GetURL() {
return download_item_->GetURL();
}
@ -116,7 +116,7 @@ bool DownloadItem::HasUserGesture() {
}
std::string DownloadItem::GetFilename() {
return base::UTF16ToUTF8(net::GenerateFileName(GetUrl(),
return base::UTF16ToUTF8(net::GenerateFileName(GetURL(),
GetContentDisposition(),
std::string(),
download_item_->GetSuggestedFilename(),
@ -152,7 +152,7 @@ mate::ObjectTemplateBuilder DownloadItem::GetObjectTemplateBuilder(
.SetMethod("cancel", &DownloadItem::Cancel)
.SetMethod("getReceivedBytes", &DownloadItem::GetReceivedBytes)
.SetMethod("getTotalBytes", &DownloadItem::GetTotalBytes)
.SetMethod("getUrl", &DownloadItem::GetUrl)
.SetMethod("getURL", &DownloadItem::GetURL)
.SetMethod("getMimeType", &DownloadItem::GetMimeType)
.SetMethod("hasUserGesture", &DownloadItem::HasUserGesture)
.SetMethod("getFilename", &DownloadItem::GetFilename)

View file

@ -49,7 +49,7 @@ class DownloadItem : public mate::EventEmitter,
bool HasUserGesture();
std::string GetFilename();
std::string GetContentDisposition();
const GURL& GetUrl();
const GURL& GetURL();
void SetSavePath(const base::FilePath& path);
private:

View file

@ -37,7 +37,7 @@ mate::ObjectTemplateBuilder Protocol::GetObjectTemplateBuilder(
.SetMethod("registerBufferProtocol",
&Protocol::RegisterProtocol<URLRequestBufferJob>)
.SetMethod("registerFileProtocol",
&Protocol::RegisterProtocol<UrlRequestAsyncAsarJob>)
&Protocol::RegisterProtocol<URLRequestAsyncAsarJob>)
.SetMethod("registerHttpProtocol",
&Protocol::RegisterProtocol<URLRequestFetchJob>)
.SetMethod("unregisterProtocol", &Protocol::UnregisterProtocol)
@ -47,7 +47,7 @@ mate::ObjectTemplateBuilder Protocol::GetObjectTemplateBuilder(
.SetMethod("interceptBufferProtocol",
&Protocol::InterceptProtocol<URLRequestBufferJob>)
.SetMethod("interceptFileProtocol",
&Protocol::InterceptProtocol<UrlRequestAsyncAsarJob>)
&Protocol::InterceptProtocol<URLRequestAsyncAsarJob>)
.SetMethod("interceptHttpProtocol",
&Protocol::InterceptProtocol<URLRequestFetchJob>)
.SetMethod("uninterceptProtocol", &Protocol::UninterceptProtocol);

View file

@ -1003,8 +1003,8 @@ mate::ObjectTemplateBuilder WebContents::GetObjectTemplateBuilder(
.SetMethod("isAlive", &WebContents::IsAlive, true)
.SetMethod("getId", &WebContents::GetID)
.SetMethod("equal", &WebContents::Equal)
.SetMethod("_loadUrl", &WebContents::LoadURL)
.SetMethod("_getUrl", &WebContents::GetURL)
.SetMethod("_loadURL", &WebContents::LoadURL)
.SetMethod("_getURL", &WebContents::GetURL)
.SetMethod("getTitle", &WebContents::GetTitle)
.SetMethod("isLoading", &WebContents::IsLoading)
.SetMethod("isWaitingForResponse", &WebContents::IsWaitingForResponse)

View file

@ -63,10 +63,11 @@ wrapDownloadItem = (downloadItem) ->
# downloadItem is an EventEmitter.
downloadItem.__proto__ = EventEmitter.prototype
# Deprecated.
deprecate.property downloadItem, 'url', 'getUrl'
deprecate.property downloadItem, 'url', 'getURL'
deprecate.property downloadItem, 'filename', 'getFilename'
deprecate.property downloadItem, 'mimeType', 'getMimeType'
deprecate.property downloadItem, 'hasUserGesture', 'hasUserGesture'
deprecate.rename downloadItem, 'getUrl', 'getURL'
downloadItemBindings._setWrapDownloadItem wrapDownloadItem
# Only one App object pemitted.

View file

@ -1,5 +1,12 @@
module.exports =
{deprecate} = require 'electron'
autoUpdater =
if process.platform is 'win32'
require './auto-updater/auto-updater-win'
else
require './auto-updater/auto-updater-native'
# Deprecated.
deprecate.rename autoUpdater, 'setFeedUrl', 'setFeedURL'
module.exports = autoUpdater

View file

@ -9,28 +9,28 @@ class AutoUpdater extends EventEmitter
squirrelUpdate.processStart()
app.quit()
setFeedUrl: (updateUrl) ->
@updateUrl = updateUrl
setFeedURL: (updateURL) ->
@updateURL = updateURL
checkForUpdates: ->
return @emitError 'Update URL is not set' unless @updateUrl
return @emitError 'Update URL is not set' unless @updateURL
return @emitError 'Can not find Squirrel' unless squirrelUpdate.supported()
@emit 'checking-for-update'
squirrelUpdate.download @updateUrl, (error, update) =>
squirrelUpdate.download @updateURL, (error, update) =>
return @emitError error if error?
return @emit 'update-not-available' unless update?
@emit 'update-available'
squirrelUpdate.update @updateUrl, (error) =>
squirrelUpdate.update @updateURL, (error) =>
return @emitError error if error?
{releaseNotes, version} = update
# Following information is not available on Windows, so fake them.
date = new Date
url = @updateUrl
url = @updateURL
@emit 'update-downloaded', {}, releaseNotes, version, date, url, => @quitAndInstall()

View file

@ -41,8 +41,8 @@ exports.processStart = (callback) ->
spawnUpdate ['--processStart', exeName], true, ->
# Download the releases specified by the URL and write new results to stdout.
exports.download = (updateUrl, callback) ->
spawnUpdate ['--download', updateUrl], false, (error, stdout) ->
exports.download = (updateURL, callback) ->
spawnUpdate ['--download', updateURL], false, (error, stdout) ->
return callback(error) if error?
try
@ -55,8 +55,8 @@ exports.download = (updateUrl, callback) ->
callback null, update
# Update the application to the latest remote version specified by URL.
exports.update = (updateUrl, callback) ->
spawnUpdate ['--update', updateUrl], false, callback
exports.update = (updateURL, callback) ->
spawnUpdate ['--update', updateURL], false, callback
# Is the Update.exe installed with the current application?
exports.supported = ->

View file

@ -69,7 +69,8 @@ BrowserWindow.fromDevToolsWebContents = (webContents) ->
return window for window in windows when window.devToolsWebContents?.equal webContents
# Helpers.
BrowserWindow::loadUrl = -> @webContents.loadUrl.apply @webContents, arguments
BrowserWindow::loadURL = -> @webContents.loadURL.apply @webContents, arguments
BrowserWindow::getURL = -> @webContents.getURL()
BrowserWindow::reload = -> @webContents.reload.apply @webContents, arguments
BrowserWindow::send = -> @webContents.send.apply @webContents, arguments
BrowserWindow::openDevTools = -> @webContents.openDevTools.apply @webContents, arguments
@ -80,14 +81,12 @@ BrowserWindow::inspectElement = -> @webContents.inspectElement.apply @webContent
BrowserWindow::inspectServiceWorker = -> @webContents.inspectServiceWorker()
# Deprecated.
deprecate.rename BrowserWindow, 'restart', 'reload'
deprecate.member BrowserWindow, 'undo', 'webContents'
deprecate.member BrowserWindow, 'redo', 'webContents'
deprecate.member BrowserWindow, 'cut', 'webContents'
deprecate.member BrowserWindow, 'copy', 'webContents'
deprecate.member BrowserWindow, 'paste', 'webContents'
deprecate.member BrowserWindow, 'selectAll', 'webContents'
deprecate.member BrowserWindow, 'getUrl', 'webContents'
deprecate.member BrowserWindow, 'reloadIgnoringCache', 'webContents'
deprecate.member BrowserWindow, 'getPageTitle', 'webContents'
deprecate.member BrowserWindow, 'isLoading', 'webContents'
@ -97,5 +96,8 @@ deprecate.member BrowserWindow, 'isCrashed', 'webContents'
deprecate.member BrowserWindow, 'executeJavaScriptInDevTools', 'webContents'
deprecate.member BrowserWindow, 'print', 'webContents'
deprecate.member BrowserWindow, 'printToPDF', 'webContents'
deprecate.rename BrowserWindow, 'restart', 'reload'
deprecate.rename BrowserWindow, 'loadUrl', 'loadURL'
deprecate.rename BrowserWindow, 'getUrl', 'getURL'
module.exports = BrowserWindow

View file

@ -9,7 +9,7 @@ ipcMain.on 'ATOM_SHELL_SYNC_NAVIGATION_CONTROLLER', (event, method, args...) ->
# JavaScript implementation of Chromium's NavigationController.
# Instead of relying on Chromium for history control, we compeletely do history
# control on user land, and only rely on WebContents.loadUrl for navigation.
# control on user land, and only rely on WebContents.loadURL for navigation.
# This helps us avoid Chromium's various optimizations so we can ensure renderer
# process is restarted everytime.
class NavigationController
@ -17,9 +17,9 @@ class NavigationController
@clearHistory()
# webContents may have already navigated to a page.
if @webContents._getUrl()
if @webContents._getURL()
@currentIndex++
@history.push @webContents._getUrl()
@history.push @webContents._getURL()
@webContents.on 'navigation-entry-commited', (event, url, inPage, replaceEntry) =>
if @inPageIndex > -1 and not inPage
@ -42,12 +42,12 @@ class NavigationController
@currentIndex++
@history.push url
loadUrl: (url, options={}) ->
loadURL: (url, options={}) ->
@pendingIndex = -1
@webContents._loadUrl url, options
@webContents._loadURL url, options
@webContents.emit 'load-url', url, options
getUrl: ->
getURL: ->
if @currentIndex is -1
''
else
@ -59,7 +59,7 @@ class NavigationController
reload: ->
@pendingIndex = @currentIndex
@webContents._loadUrl @getUrl(), {}
@webContents._loadURL @getURL(), {}
reloadIgnoringCache: ->
@webContents._reloadIgnoringCache() # Rely on WebContents to clear cache.
@ -89,7 +89,7 @@ class NavigationController
if @inPageIndex > -1 and @pendingIndex >= @inPageIndex
@webContents._goBack()
else
@webContents._loadUrl @history[@pendingIndex], {}
@webContents._loadURL @history[@pendingIndex], {}
goForward: ->
return unless @canGoForward()
@ -97,12 +97,12 @@ class NavigationController
if @inPageIndex > -1 and @pendingIndex >= @inPageIndex
@webContents._goForward()
else
@webContents._loadUrl @history[@pendingIndex], {}
@webContents._loadURL @history[@pendingIndex], {}
goToIndex: (index) ->
return unless @canGoToIndex index
@pendingIndex = index
@webContents._loadUrl @history[@pendingIndex], {}
@webContents._loadURL @history[@pendingIndex], {}
goToOffset: (offset) ->
return unless @canGoToOffset offset

View file

@ -1,5 +1,5 @@
{EventEmitter} = require 'events'
{ipcMain, NavigationController, Menu} = require 'electron'
{deprecate, ipcMain, NavigationController, Menu} = require 'electron'
binding = process.atomBinding 'web_contents'
@ -45,7 +45,7 @@ wrapWebContents = (webContents) ->
# Make sure webContents.executeJavaScript would run the code only when the
# web contents has been loaded.
webContents.executeJavaScript = (code, hasUserGesture=false) ->
if @getUrl() and not @isLoading()
if @getURL() and not @isLoading()
@_executeJavaScript code, hasUserGesture
else
webContents.once 'did-finish-load', @_executeJavaScript.bind(this, code, hasUserGesture)
@ -70,6 +70,10 @@ wrapWebContents = (webContents) ->
menu = Menu.buildFromTemplate params.menu
menu.popup params.x, params.y
# Deprecated.
deprecate.rename webContents, 'loadUrl', 'loadURL'
deprecate.rename webContents, 'getUrl', 'getURL'
webContents.printToPDF = (options, callback) ->
printingSetting =
pageRage: []

View file

@ -18,7 +18,7 @@ namespace {
// Notice that we just combined the api key with the url together here, because
// if we use the standard {url: key} format Chromium would override our key with
// the predefined one in common.gypi of libchromiumcontent, which is empty.
const char* kGeolocationProviderUrl =
const char* kGeolocationProviderURL =
"https://www.googleapis.com/geolocation/v1/geolocate?key="
GOOGLEAPIS_API_KEY;
@ -35,11 +35,11 @@ void AtomAccessTokenStore::LoadAccessTokens(
const LoadAccessTokensCallbackType& callback) {
AccessTokenSet access_token_set;
// Equivelent to access_token_set[kGeolocationProviderUrl].
// Equivelent to access_token_set[kGeolocationProviderURL].
// Somehow base::string16 is causing compilation errors when used in a pair
// of std::map on Linux, this can work around it.
std::pair<GURL, base::string16> token_pair;
token_pair.first = GURL(kGeolocationProviderUrl);
token_pair.first = GURL(kGeolocationProviderURL);
access_token_set.insert(token_pair);
auto browser_context = AtomBrowserMainParts::Get()->browser_context();

View file

@ -16,6 +16,6 @@ app.on('ready', function() {
autoHideMenuBar: true,
useContentSize: true,
});
mainWindow.loadUrl('file://' + __dirname + '/index.html');
mainWindow.loadURL('file://' + __dirname + '/index.html');
mainWindow.focus();
});

View file

@ -79,7 +79,7 @@ createGuest = (embedder, params) ->
opts = {}
opts.httpReferrer = params.httpreferrer if params.httpreferrer
opts.userAgent = params.useragent if params.useragent
@loadUrl params.src, opts
@loadURL params.src, opts
if params.allowtransparency?
@setAllowTransparency params.allowtransparency
@ -122,7 +122,7 @@ attachGuest = (embedder, elementInstanceId, guestInstanceId, params) ->
nodeIntegration: params.nodeintegration ? false
plugins: params.plugins
webSecurity: !params.disablewebsecurity
webPreferences.preloadUrl = params.preload if params.preload
webPreferences.preloadURL = params.preload if params.preload
webViewManager.addGuest guestInstanceId, elementInstanceId, embedder, guest, webPreferences
guest.attachParams = params

View file

@ -27,11 +27,11 @@ mergeBrowserWindowOptions = (embedder, options) ->
createGuest = (embedder, url, frameName, options) ->
guest = frameToGuest[frameName]
if frameName and guest?
guest.loadUrl url
guest.loadURL url
return guest.id
guest = new BrowserWindow(options)
guest.loadUrl url
guest.loadURL url
# Remember the embedder, will be used by window.opener methods.
v8Util.setHiddenValue guest.webContents, 'embedder', embedder
@ -74,12 +74,12 @@ ipcMain.on 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_METHOD', (event, guestId, met
ipcMain.on 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_POSTMESSAGE', (event, guestId, message, targetOrigin) ->
guestContents = BrowserWindow.fromId(guestId)?.webContents
if guestContents?.getUrl().indexOf(targetOrigin) is 0 or targetOrigin is '*'
if guestContents?.getURL().indexOf(targetOrigin) is 0 or targetOrigin is '*'
guestContents.send 'ATOM_SHELL_GUEST_WINDOW_POSTMESSAGE', guestId, message, targetOrigin
ipcMain.on 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_OPENER_POSTMESSAGE', (event, guestId, message, targetOrigin, sourceOrigin) ->
embedder = v8Util.getHiddenValue event.sender, 'embedder'
if embedder?.getUrl().indexOf(targetOrigin) is 0 or targetOrigin is '*'
if embedder?.getURL().indexOf(targetOrigin) is 0 or targetOrigin is '*'
embedder.send 'ATOM_SHELL_GUEST_WINDOW_POSTMESSAGE', guestId, message, sourceOrigin
ipcMain.on 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WEB_CONTENTS_METHOD', (event, guestId, method, args...) ->

View file

@ -6,13 +6,13 @@
namespace atom {
UrlRequestAsyncAsarJob::UrlRequestAsyncAsarJob(
URLRequestAsyncAsarJob::URLRequestAsyncAsarJob(
net::URLRequest* request,
net::NetworkDelegate* network_delegate)
: JsAsker<asar::URLRequestAsarJob>(request, network_delegate) {
}
void UrlRequestAsyncAsarJob::StartAsync(scoped_ptr<base::Value> options) {
void URLRequestAsyncAsarJob::StartAsync(scoped_ptr<base::Value> options) {
base::FilePath::StringType file_path;
if (options->IsType(base::Value::TYPE_DICTIONARY)) {
static_cast<base::DictionaryValue*>(options.get())->GetString(

View file

@ -11,15 +11,15 @@
namespace atom {
// Like URLRequestAsarJob, but asks the JavaScript handler for file path.
class UrlRequestAsyncAsarJob : public JsAsker<asar::URLRequestAsarJob> {
class URLRequestAsyncAsarJob : public JsAsker<asar::URLRequestAsarJob> {
public:
UrlRequestAsyncAsarJob(net::URLRequest*, net::NetworkDelegate*);
URLRequestAsyncAsarJob(net::URLRequest*, net::NetworkDelegate*);
// JsAsker:
void StartAsync(scoped_ptr<base::Value> options) override;
private:
DISALLOW_COPY_AND_ASSIGN(UrlRequestAsyncAsarJob);
DISALLOW_COPY_AND_ASSIGN(URLRequestAsyncAsarJob);
};
} // namespace atom

View file

@ -113,7 +113,7 @@ void WebContentsPreferences::AppendExtraCommandLineSwitches(
command_line->AppendSwitchNative(switches::kPreloadScript, preload);
else
LOG(ERROR) << "preload script must have absolute path.";
} else if (web_preferences.GetString(options::kPreloadUrl, &preload)) {
} else if (web_preferences.GetString(options::kPreloadURL, &preload)) {
// Translate to file path if there is "preload-url" option.
base::FilePath preload_path;
if (net::FileURLToFilePath(GURL(preload), &preload_path))

View file

@ -168,7 +168,8 @@ mate::ObjectTemplateBuilder NativeImage::GetObjectTemplateBuilder(
template_.Reset(isolate, mate::ObjectTemplateBuilder(isolate)
.SetMethod("toPng", &NativeImage::ToPNG)
.SetMethod("toJpeg", &NativeImage::ToJPEG)
.SetMethod("toDataUrl", &NativeImage::ToDataURL)
.SetMethod("toDataURL", &NativeImage::ToDataURL)
.SetMethod("toDataUrl", &NativeImage::ToDataURL) // deprecated.
.SetMethod("isEmpty", &NativeImage::IsEmpty)
.SetMethod("getSize", &NativeImage::GetSize)
.SetMethod("setTemplateImage", &NativeImage::SetTemplateImage)
@ -309,7 +310,7 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
dict.SetMethod("createEmpty", &atom::api::NativeImage::CreateEmpty);
dict.SetMethod("createFromPath", &atom::api::NativeImage::CreateFromPath);
dict.SetMethod("createFromBuffer", &atom::api::NativeImage::CreateFromBuffer);
dict.SetMethod("createFromDataUrl",
dict.SetMethod("createFromDataURL",
&atom::api::NativeImage::CreateFromDataURL);
}

View file

@ -1,14 +1,21 @@
binding = process.atomBinding 'crash_reporter'
fs = require 'fs'
os = require 'os'
path = require 'path'
{spawn} = require 'child_process'
electron = require 'electron'
binding = process.atomBinding 'crash_reporter'
class CrashReporter
start: (options={}) ->
{@productName, companyName, submitUrl, autoSubmit, ignoreSystemCrashHandler, extra} = options
{@productName, companyName, submitURL, autoSubmit, ignoreSystemCrashHandler, extra} = options
# Deprecated.
{deprecate} = electron
if options.submitUrl
submitURL ?= options.submitUrl
deprecate.warn 'submitUrl', 'submitURL'
electron = require 'electron'
{app} =
if process.type is 'browser'
electron
@ -17,7 +24,7 @@ class CrashReporter
@productName ?= app.getName()
companyName ?= 'GitHub, Inc'
submitUrl ?= 'http://54.249.141.255:1127/post'
submitURL ?= 'http://54.249.141.255:1127/post'
autoSubmit ?= true
ignoreSystemCrashHandler ?= false
extra ?= {}
@ -26,11 +33,11 @@ class CrashReporter
extra._companyName ?= companyName
extra._version ?= app.getVersion()
start = => binding.start @productName, companyName, submitUrl, autoSubmit, ignoreSystemCrashHandler, extra
start = => binding.start @productName, companyName, submitURL, autoSubmit, ignoreSystemCrashHandler, extra
if process.platform is 'win32'
args = [
"--reporter-url=#{submitUrl}"
"--reporter-url=#{submitURL}"
"--application-name=#{@productName}"
"--v=1"
]

View file

@ -1 +1,7 @@
module.exports = process.atomBinding 'native_image'
{deprecate} = require 'electron'
nativeImage = process.atomBinding 'native_image'
# Deprecated.
deprecate.rename nativeImage, 'createFromDataUrl', 'createFromDataURL'
module.exports = nativeImage

View file

@ -77,7 +77,7 @@ const char kZoomFactor[] = "zoomFactor";
const char kPreloadScript[] = "preload";
// Like --preload, but the passed argument is an URL.
const char kPreloadUrl[] = "preloadUrl";
const char kPreloadURL[] = "preloadURL";
// Enable the node integration.
const char kNodeIntegration[] = "nodeIntegration";
@ -133,7 +133,7 @@ const char kAppUserModelId[] = "app-user-model-id";
// The command line switch versions of the options.
const char kZoomFactor[] = "zoom-factor";
const char kPreloadScript[] = "preload";
const char kPreloadUrl[] = "preload-url";
const char kPreloadURL[] = "preload-url";
const char kNodeIntegration[] = "node-integration";
const char kGuestInstanceID[] = "guest-instance-id";
const char kExperimentalFeatures[] = "experimental-features";

View file

@ -44,7 +44,7 @@ extern const char kWebPreferences[];
extern const char kDirectWrite[];
extern const char kZoomFactor[];
extern const char kPreloadScript[];
extern const char kPreloadUrl[];
extern const char kPreloadURL[];
extern const char kNodeIntegration[];
extern const char kGuestInstanceID[];
extern const char kExperimentalFeatures[];
@ -73,7 +73,7 @@ extern const char kAppUserModelId[];
extern const char kZoomFactor[];
extern const char kPreloadScript[];
extern const char kPreloadUrl[];
extern const char kPreloadURL[];
extern const char kNodeIntegration[];
extern const char kGuestInstanceID[];
extern const char kExperimentalFeatures[];

View file

@ -307,8 +307,8 @@ bool OpenExternal(const GURL& url) {
// "Some versions of windows (Win2k before SP3, Win XP before SP1) crash in
// ShellExecute on long URLs (bug 161357 on bugzilla.mozilla.org). IE 5 and 6
// support URLS of 2083 chars in length, 2K is safe."
const size_t kMaxUrlLength = 2048;
if (escaped_url.length() > kMaxUrlLength) {
const size_t kMaxURLLength = 2048;
if (escaped_url.length() > kMaxURLLength) {
NOTREACHED();
return false;
}

View file

@ -98,7 +98,7 @@ void WebFrame::RegisterURLSchemeAsSecure(const std::string& scheme) {
blink::WebString::fromUTF8(scheme));
}
void WebFrame::RegisterURLSchemeAsBypassingCsp(const std::string& scheme) {
void WebFrame::RegisterURLSchemeAsBypassingCSP(const std::string& scheme) {
// Register scheme to bypass pages's Content Security Policy.
blink::WebSecurityPolicy::registerURLSchemeAsBypassingContentSecurityPolicy(
blink::WebString::fromUTF8(scheme));
@ -129,11 +129,11 @@ mate::ObjectTemplateBuilder WebFrame::GetObjectTemplateBuilder(
&WebFrame::RegisterElementResizeCallback)
.SetMethod("attachGuest", &WebFrame::AttachGuest)
.SetMethod("setSpellCheckProvider", &WebFrame::SetSpellCheckProvider)
.SetMethod("registerUrlSchemeAsSecure",
.SetMethod("registerURLSchemeAsSecure",
&WebFrame::RegisterURLSchemeAsSecure)
.SetMethod("registerUrlSchemeAsBypassingCsp",
&WebFrame::RegisterURLSchemeAsBypassingCsp)
.SetMethod("registerUrlSchemeAsPrivileged",
.SetMethod("registerURLSchemeAsBypassingCSP",
&WebFrame::RegisterURLSchemeAsBypassingCSP)
.SetMethod("registerURLSchemeAsPrivileged",
&WebFrame::RegisterURLSchemeAsPrivileged);
}

View file

@ -57,7 +57,7 @@ class WebFrame : public mate::Wrappable {
v8::Local<v8::Object> provider);
void RegisterURLSchemeAsSecure(const std::string& scheme);
void RegisterURLSchemeAsBypassingCsp(const std::string& scheme);
void RegisterURLSchemeAsBypassingCSP(const std::string& scheme);
void RegisterURLSchemeAsPrivileged(const std::string& scheme);
// mate::Wrappable:

View file

@ -1 +1,9 @@
module.exports = process.atomBinding('web_frame').webFrame
{deprecate} = require 'electron'
{webFrame} = process.atomBinding 'web_frame'
# Deprecated.
deprecate.rename webFrame, 'registerUrlSchemeAsSecure', 'registerURLSchemeAsSecure'
deprecate.rename webFrame, 'registerUrlSchemeAsBypassingCSP', 'registerURLSchemeAsBypassingCSP'
deprecate.rename webFrame, 'registerUrlSchemeAsPrivileged', 'registerURLSchemeAsPrivileged'
module.exports = webFrame

View file

@ -2,7 +2,7 @@
# Helper function to resolve relative url.
a = window.top.document.createElement 'a'
resolveUrl = (url) ->
resolveURL = (url) ->
a.href = url
a.href
@ -55,7 +55,7 @@ window.open = (url, frameName='', features='') ->
options.height ?= 600
# Resolve relative urls.
url = resolveUrl url
url = resolveURL url
(options[name] = parseInt(options[name], 10) if options[name]?) for name in ints

View file

@ -5,14 +5,14 @@ requestId = 0
WEB_VIEW_EVENTS =
'load-commit': ['url', 'isMainFrame']
'did-finish-load': []
'did-fail-load': ['errorCode', 'errorDescription', 'validatedUrl']
'did-fail-load': ['errorCode', 'errorDescription', 'validatedURL']
'did-frame-finish-load': ['isMainFrame']
'did-start-loading': []
'did-stop-loading': []
'did-get-response-details': ['status', 'newUrl', 'originalUrl',
'did-get-response-details': ['status', 'newURL', 'originalURL',
'httpResponseCode', 'requestMethod', 'referrer',
'headers']
'did-get-redirect-request': ['oldUrl', 'newUrl', 'isMainFrame']
'did-get-redirect-request': ['oldURL', 'newURL', 'isMainFrame']
'dom-ready': []
'console-message': ['level', 'message', 'line', 'sourceId']
'new-window': ['url', 'frameName', 'disposition', 'options']

View file

@ -6,7 +6,7 @@ webViewConstants = require './web-view-constants'
# Helper function to resolve url set in attribute.
a = document.createElement 'a'
resolveUrl = (url) ->
resolveURL = (url) ->
a.href = url
a.href
@ -116,7 +116,7 @@ class SrcAttribute extends WebViewAttribute
getValue: ->
if @webViewImpl.webviewNode.hasAttribute @name
resolveUrl @webViewImpl.webviewNode.getAttribute(@name)
resolveURL @webViewImpl.webviewNode.getAttribute(@name)
else
''
@ -178,7 +178,7 @@ class SrcAttribute extends WebViewAttribute
if useragent then opts.userAgent = useragent
guestContents = remote.getGuestWebContents(@webViewImpl.guestInstanceId)
guestContents.loadUrl @getValue(), opts
guestContents.loadURL @getValue(), opts
# Attribute specifies HTTP referrer.
class HttpReferrerAttribute extends WebViewAttribute
@ -197,7 +197,7 @@ class PreloadAttribute extends WebViewAttribute
getValue: ->
return '' unless @webViewImpl.webviewNode.hasAttribute @name
preload = resolveUrl @webViewImpl.webviewNode.getAttribute(@name)
preload = resolveURL @webViewImpl.webviewNode.getAttribute(@name)
protocol = preload.substr 0, 5
unless protocol is 'file:'
console.error webViewConstants.ERROR_MSG_INVALID_PRELOAD_ATTRIBUTE

View file

@ -1,4 +1,4 @@
{webFrame, remote} = require 'electron'
{deprecate, webFrame, remote} = require 'electron'
v8Util = process.atomBinding 'v8_util'
guestViewInternal = require './guest-view-internal'
@ -252,49 +252,49 @@ registerWebViewElement = ->
# Public-facing API methods.
methods = [
"getUrl"
"getTitle"
"isLoading"
"isWaitingForResponse"
"stop"
"reload"
"reloadIgnoringCache"
"canGoBack"
"canGoForward"
"canGoToOffset"
"clearHistory"
"goBack"
"goForward"
"goToIndex"
"goToOffset"
"isCrashed"
"setUserAgent"
"getUserAgent"
"executeJavaScript"
"insertCSS"
"openDevTools"
"closeDevTools"
"isDevToolsOpened"
"inspectElement"
"setAudioMuted"
"isAudioMuted"
"undo"
"redo"
"cut"
"copy"
"paste"
"pasteAndMatchStyle"
"delete"
"selectAll"
"unselect"
"replace"
"replaceMisspelling"
"send"
"getId"
"inspectServiceWorker"
"print"
"printToPDF"
"sendInputEvent"
'getURL'
'getTitle'
'isLoading'
'isWaitingForResponse'
'stop'
'reload'
'reloadIgnoringCache'
'canGoBack'
'canGoForward'
'canGoToOffset'
'clearHistory'
'goBack'
'goForward'
'goToIndex'
'goToOffset'
'isCrashed'
'setUserAgent'
'getUserAgent'
'executeJavaScript'
'insertCSS'
'openDevTools'
'closeDevTools'
'isDevToolsOpened'
'inspectElement'
'setAudioMuted'
'isAudioMuted'
'undo'
'redo'
'cut'
'copy'
'paste'
'pasteAndMatchStyle'
'delete'
'selectAll'
'unselect'
'replace'
'replaceMisspelling'
'send'
'getId'
'inspectServiceWorker'
'print'
'printToPDF'
'sendInputEvent'
]
# Forward proto.foo* method calls to WebViewImpl.foo*.
@ -304,6 +304,9 @@ registerWebViewElement = ->
internal.webContents[m] args...
proto[m] = createHandler m for m in methods
# Deprecated.
deprecate.rename proto, 'getUrl', 'getURL'
window.WebView = webFrame.registerEmbedderCustomElement 'webview',
prototype: proto

View file

@ -67,7 +67,7 @@ Returns:
* `releaseNotes` String
* `releaseName` String
* `releaseDate` Date
* `updateUrl` String
* `updateURL` String
Emitted when an update has been downloaded.
@ -77,7 +77,7 @@ On Windows only `releaseName` is available.
The `autoUpdater` object has the following methods:
### `autoUpdater.setFeedUrl(url)`
### `autoUpdater.setFeedURL(url)`
* `url` String
@ -86,7 +86,7 @@ once it is set.
### `autoUpdater.checkForUpdates()`
Asks the server whether there is an update. You must call `setFeedUrl` before
Asks the server whether there is an update. You must call `setFeedURL` before
using this API.
### `autoUpdater.quitAndInstall()`

View file

@ -11,7 +11,7 @@ win.on('closed', function() {
win = null;
});
win.loadUrl('https://github.com');
win.loadURL('https://github.com');
win.show();
```
@ -613,9 +613,9 @@ Same as `webContents.print([options])`
Same as `webContents.printToPDF(options, callback)`
### `win.loadUrl(url[, options])`
### `win.loadURL(url[, options])`
Same as `webContents.loadUrl(url[, options])`.
Same as `webContents.loadURL(url[, options])`.
### `win.reload()`

View file

@ -11,7 +11,7 @@ const crashReporter = require('electron').crashReporter;
crashReporter.start({
productName: 'YourName',
companyName: 'YourCompany',
submitUrl: 'https://your-domain.com/url-to-submit',
submitURL: 'https://your-domain.com/url-to-submit',
autoSubmit: true
});
```
@ -26,7 +26,7 @@ The `crash-reporter` module has the following methods:
* `productName` String, default: Electron.
* `companyName` String, default: GitHub, Inc.
* `submitUrl` String, default: http://54.249.141.255:1127/post.
* `submitURL` String, default: http://54.249.141.255:1127/post.
* URL that crash reports will be sent to as POST.
* `autoSubmit` Boolean, default: `true`.
* Send the crash report without user interaction.
@ -57,7 +57,7 @@ ID.
## crash-reporter Payload
The crash reporter will send the following data to the `submitUrl` as `POST`:
The crash reporter will send the following data to the `submitURL` as `POST`:
* `ver` String - The version of Electron.
* `platform` String - e.g. 'win32'.

View file

@ -66,7 +66,7 @@ Resumes the download that has been paused.
Cancels the download operation.
### `downloadItem.getUrl()`
### `downloadItem.getURL()`
Returns a `String` represents the origin url where the item is downloaded from.

View file

@ -103,11 +103,11 @@ Creates a new `nativeImage` instance from a file located at `path`.
Creates a new `nativeImage` instance from `buffer`. The default `scaleFactor` is
1.0.
### `nativeImage.createFromDataUrl(dataUrl)`
### `nativeImage.createFromDataURL(dataURL)`
* `dataUrl` String
* `dataURL` String
Creates a new `nativeImage` instance from `dataUrl`.
Creates a new `nativeImage` instance from `dataURL`.
## Instance Methods
@ -129,7 +129,7 @@ Returns a [Buffer][buffer] that contains the image's `PNG` encoded data.
Returns a [Buffer][buffer] that contains the image's `JPEG` encoded data.
### `image.toDataUrl()`
### `image.toDataURL()`
Returns the data URL of the image.

View file

@ -16,7 +16,7 @@ const remote = require('electron').remote;
const BrowserWindow = remote.require('electron').BrowserWindow;
var win = new BrowserWindow({ width: 800, height: 600 });
win.loadUrl('https://github.com');
win.loadURL('https://github.com');
```
**Note:** for the reverse (access the renderer process from the main process),

View file

@ -8,7 +8,7 @@ instance of `BrowserWindow`. For example:
const BrowserWindow = require('electron').BrowserWindow;
var win = new BrowserWindow({ width: 800, height: 600 });
win.loadUrl("http://github.com");
win.loadURL("http://github.com");
var session = win.webContents.session
```
@ -28,7 +28,7 @@ Calling `event.preventDefault()` will cancel the download.
```javascript
session.on('will-download', function(event, item, webContents) {
event.preventDefault();
require('request')(item.getUrl(), function(data) {
require('request')(item.getURL(), function(data) {
require('fs').writeFileSync('/somewhere', data);
});
});
@ -47,7 +47,7 @@ const BrowserWindow = require('electron').BrowserWindow;
var win = new BrowserWindow({ width: 800, height: 600 });
win.loadUrl('https://github.com');
win.loadURL('https://github.com');
win.webContents.on('did-finish-load', function() {
// Query all cookies.

View file

@ -25,7 +25,7 @@ var window = null;
app.on('ready', function() {
window = new BrowserWindow({width: 800, height: 600});
window.loadUrl('https://github.com');
window.loadURL('https://github.com');
});
```

View file

@ -11,7 +11,7 @@ the [`BrowserWindow`](browser-window.md) object. An example of accessing the
const BrowserWindow = require('electron').BrowserWindow;
var win = new BrowserWindow({width: 800, height: 1500});
win.loadUrl("http://github.com");
win.loadURL("http://github.com");
var webContents = win.webContents;
```
@ -32,7 +32,7 @@ Returns:
* `event` Event
* `errorCode` Integer
* `errorDescription` String
* `validatedUrl` String
* `validatedURL` String
This event is like `did-finish-load` but emitted when the load failed or was
cancelled, e.g. `window.stop()` is invoked.
@ -61,8 +61,8 @@ Returns:
* `event` Event
* `status` Boolean
* `newUrl` String
* `originalUrl` String
* `newURL` String
* `originalURL` String
* `httpResponseCode` Integer
* `requestMethod` String
* `referrer` String
@ -76,8 +76,8 @@ Emitted when details regarding a requested resource are available.
Returns:
* `event` Event
* `oldUrl` String
* `newUrl` String
* `oldURL` String
* `newURL` String
* `isMainFrame` Boolean
* `httpResponseCode` Integer
* `requestMethod` String
@ -99,7 +99,7 @@ Emitted when the document in the given frame is loaded.
Returns:
* `event` Event
* `favicons` Array - Array of Urls
* `favicons` Array - Array of URLs
Emitted when page receives favicon urls.
@ -133,7 +133,7 @@ Emitted when a user or the page wants to start navigation. It can happen when th
`window.location` object is changed or a user clicks a link in the page.
This event will not emit when the navigation is started programmatically with
APIs like `webContents.loadUrl` and `webContents.back`.
APIs like `webContents.loadURL` and `webContents.back`.
Calling `event.preventDefault()` will prevent the navigation.
@ -198,7 +198,7 @@ Returns the `session` object used by this webContents.
See [session documentation](session.md) for this object's methods.
### `webContents.loadUrl(url[, options])`
### `webContents.loadURL(url[, options])`
* `url` URL
* `options` Object (optional), properties:
@ -209,15 +209,15 @@ See [session documentation](session.md) for this object's methods.
Loads the `url` in the window, the `url` must contain the protocol prefix,
e.g. the `http://` or `file://`.
### `webContents.getUrl()`
### `webContents.getURL()`
Returns URL of the current web page.
```javascript
var win = new BrowserWindow({width: 800, height: 600});
win.loadUrl("http://github.com");
win.loadURL("http://github.com");
var currentUrl = win.webContents.getUrl();
var currentURL = win.webContents.getURL();
```
### `webContents.getTitle()`
@ -447,7 +447,7 @@ const BrowserWindow = require('electron').BrowserWindow;
const fs = require('fs');
var win = new BrowserWindow({width: 800, height: 600});
win.loadUrl("http://github.com");
win.loadURL("http://github.com");
win.webContents.on("did-finish-load", function() {
// Use default printing options
@ -524,7 +524,7 @@ An example of sending messages from the main process to the renderer process:
var window = null;
app.on('ready', function() {
window = new BrowserWindow({width: 800, height: 600});
window.loadUrl('file://' + __dirname + '/index.html');
window.loadURL('file://' + __dirname + '/index.html');
window.webContents.on('did-finish-load', function() {
window.webContents.send('ping', 'whoooooooh!');
});
@ -660,7 +660,7 @@ when the DevTools has been closed.
Returns true if the process of saving page has been initiated successfully.
```javascript
win.loadUrl('https://github.com');
win.loadURL('https://github.com');
win.webContents.on('did-finish-load', function() {
win.webContents.savePage('/tmp/test.html', 'HTMLComplete', function(error) {

View file

@ -66,7 +66,7 @@ webFrame.setSpellCheckProvider("en-US", true, {
});
```
### `webFrame.registerUrlSchemeAsSecure(scheme)`
### `webFrame.registerURLSchemeAsSecure(scheme)`
* `scheme` String
@ -76,14 +76,14 @@ Secure schemes do not trigger mixed content warnings. For example, `https` and
`data` are secure schemes because they cannot be corrupted by active network
attackers.
### `webFrame.registerUrlSchemeAsBypassingCsp(scheme)`
### `webFrame.registerURLSchemeAsBypassingCSP(scheme)`
* `scheme` String
Resources will be loaded from this `scheme` regardless of the current page's
Content Security Policy.
### `webFrame.registerUrlSchemeAsPrivileged(scheme)`
### `webFrame.registerURLSchemeAsPrivileged(scheme)`
* `scheme` String

View file

@ -170,7 +170,7 @@ webview.addEventListener("dom-ready", function() {
});
```
### `<webview>.getUrl()`
### `<webview>.getURL()`
Returns URL of guest page.
@ -402,7 +402,7 @@ Returns:
* `errorCode` Integer
* `errorDescription` String
* `validatedUrl` String
* `validatedURL` String
This event is like `did-finish-load`, but fired when the load failed or was
cancelled, e.g. `window.stop()` is invoked.
@ -428,8 +428,8 @@ Corresponds to the points in time when the spinner of the tab stops spinning.
Returns:
* `status` Boolean
* `newUrl` String
* `originalUrl` String
* `newURL` String
* `originalURL` String
* `httpResponseCode` Integer
* `requestMethod` String
* `referrer` String
@ -442,8 +442,8 @@ Fired when details regarding a requested resource is available.
Returns:
* `oldUrl` String
* `newUrl` String
* `oldURL` String
* `newURL` String
* `isMainFrame` Boolean
Fired when a redirect was received while requesting a resource.
@ -466,7 +466,7 @@ url.
Returns:
* `favicons` Array - Array of Urls.
* `favicons` Array - Array of URLs.
Fired when page receives favicon urls.

View file

@ -73,7 +73,7 @@ You can also display a web page in an `asar` archive with `BrowserWindow`:
```javascript
const BrowserWindow = require('electron').BrowserWindow;
var win = new BrowserWindow({width: 800, height: 600});
win.loadUrl('file:///path/to/example.asar/static/index.html');
win.loadURL('file:///path/to/example.asar/static/index.html');
```
### Web API

View file

@ -13,7 +13,7 @@ const BrowserWindow = electron.BrowserWindow;
var onlineStatusWindow;
app.on('ready', function() {
onlineStatusWindow = new BrowserWindow({ width: 0, height: 0, show: false });
onlineStatusWindow.loadUrl('file://' + __dirname + '/online-status.html');
onlineStatusWindow.loadURL('file://' + __dirname + '/online-status.html');
});
```
@ -54,7 +54,7 @@ const BrowserWindow = electron.BrowserWindow;
var onlineStatusWindow;
app.on('ready', function() {
onlineStatusWindow = new BrowserWindow({ width: 0, height: 0, show: false });
onlineStatusWindow.loadUrl('file://' + __dirname + '/online-status.html');
onlineStatusWindow.loadURL('file://' + __dirname + '/online-status.html');
});
ipcMain.on('online-status-changed', function(event, status) {

View file

@ -105,7 +105,7 @@ app.on('ready', function() {
mainWindow = new BrowserWindow({width: 800, height: 600});
// and load the index.html of the app.
mainWindow.loadUrl('file://' + __dirname + '/index.html');
mainWindow.loadURL('file://' + __dirname + '/index.html');
// Open the DevTools.
mainWindow.webContents.openDevTools();

View file

@ -36,7 +36,7 @@ app.on('ready', function() {
'plugins': true
}
});
mainWindow.loadUrl('file://' + __dirname + '/index.html');
mainWindow.loadURL('file://' + __dirname + '/index.html');
// Something else
});
```

View file

@ -31,14 +31,14 @@ describe 'browser-window module', ->
fs.unlinkSync(test)
assert.equal String(content), 'unload'
done()
w.loadUrl 'file://' + path.join(fixtures, 'api', 'unload.html')
w.loadURL 'file://' + path.join(fixtures, 'api', 'unload.html')
it 'should emit beforeunload handler', (done) ->
w.on 'onbeforeunload', ->
done()
w.webContents.on 'did-finish-load', ->
w.close()
w.loadUrl 'file://' + path.join(fixtures, 'api', 'beforeunload-false.html')
w.loadURL 'file://' + path.join(fixtures, 'api', 'beforeunload-false.html')
describe 'window.close()', ->
it 'should emit unload handler', (done) ->
@ -48,23 +48,23 @@ describe 'browser-window module', ->
fs.unlinkSync(test)
assert.equal String(content), 'close'
done()
w.loadUrl 'file://' + path.join(fixtures, 'api', 'close.html')
w.loadURL 'file://' + path.join(fixtures, 'api', 'close.html')
it 'should emit beforeunload handler', (done) ->
w.on 'onbeforeunload', ->
done()
w.loadUrl 'file://' + path.join(fixtures, 'api', 'close-beforeunload-false.html')
w.loadURL 'file://' + path.join(fixtures, 'api', 'close-beforeunload-false.html')
describe 'BrowserWindow.loadUrl(url)', ->
describe 'BrowserWindow.loadURL(url)', ->
it 'should emit did-start-loading event', (done) ->
w.webContents.on 'did-start-loading', ->
done()
w.loadUrl 'about:blank'
w.loadURL 'about:blank'
it 'should emit did-fail-load event', (done) ->
w.webContents.on 'did-fail-load', ->
done()
w.loadUrl 'file://a.txt'
w.loadURL 'file://a.txt'
describe 'BrowserWindow.show()', ->
it 'should focus on window', ->
@ -214,7 +214,7 @@ describe 'browser-window module', ->
show: false
webPreferences:
preload: preload
w.loadUrl 'file://' + path.join(fixtures, 'api', 'preload.html')
w.loadURL 'file://' + path.join(fixtures, 'api', 'preload.html')
describe '"node-integration" option', ->
it 'disables node integration when specified to false', (done) ->
@ -228,28 +228,28 @@ describe 'browser-window module', ->
webPreferences:
preload: preload
nodeIntegration: false
w.loadUrl 'file://' + path.join(fixtures, 'api', 'blank.html')
w.loadURL 'file://' + path.join(fixtures, 'api', 'blank.html')
describe 'beforeunload handler', ->
it 'returning true would not prevent close', (done) ->
w.on 'closed', ->
done()
w.loadUrl 'file://' + path.join(fixtures, 'api', 'close-beforeunload-true.html')
w.loadURL 'file://' + path.join(fixtures, 'api', 'close-beforeunload-true.html')
it 'returning non-empty string would not prevent close', (done) ->
w.on 'closed', ->
done()
w.loadUrl 'file://' + path.join(fixtures, 'api', 'close-beforeunload-string.html')
w.loadURL 'file://' + path.join(fixtures, 'api', 'close-beforeunload-string.html')
it 'returning false would prevent close', (done) ->
w.on 'onbeforeunload', ->
done()
w.loadUrl 'file://' + path.join(fixtures, 'api', 'close-beforeunload-false.html')
w.loadURL 'file://' + path.join(fixtures, 'api', 'close-beforeunload-false.html')
it 'returning empty string would prevent close', (done) ->
w.on 'onbeforeunload', ->
done()
w.loadUrl 'file://' + path.join(fixtures, 'api', 'close-beforeunload-empty-string.html')
w.loadURL 'file://' + path.join(fixtures, 'api', 'close-beforeunload-empty-string.html')
describe 'new-window event', ->
return if isCI and process.platform is 'darwin'
@ -259,7 +259,7 @@ describe 'browser-window module', ->
assert.equal url, 'http://host/'
assert.equal frameName, 'host'
done()
w.loadUrl "file://#{fixtures}/pages/window-open.html"
w.loadURL "file://#{fixtures}/pages/window-open.html"
it 'emits when link with target is called', (done) ->
w.webContents.once 'new-window', (e, url, frameName) ->
@ -267,7 +267,7 @@ describe 'browser-window module', ->
assert.equal url, 'http://host/'
assert.equal frameName, 'target'
done()
w.loadUrl "file://#{fixtures}/pages/target-name.html"
w.loadURL "file://#{fixtures}/pages/target-name.html"
describe 'maximize event', ->
return if isCI
@ -296,7 +296,7 @@ describe 'browser-window module', ->
xdescribe 'beginFrameSubscription method', ->
it 'subscribes frame updates', (done) ->
w.loadUrl "file://#{fixtures}/api/blank.html"
w.loadURL "file://#{fixtures}/api/blank.html"
w.webContents.beginFrameSubscription (data) ->
assert.notEqual data.length, 0
w.webContents.endFrameSubscription()
@ -321,4 +321,4 @@ describe 'browser-window module', ->
fs.rmdirSync savePageDir
done()
w.loadUrl "file://#{fixtures}/pages/save_page/index.html"
w.loadURL "file://#{fixtures}/pages/save_page/index.html"

View file

@ -11,7 +11,7 @@ describe 'clipboard module', ->
p = path.join fixtures, 'assets', 'logo.png'
i = nativeImage.createFromPath p
clipboard.writeImage p
assert.equal clipboard.readImage().toDataUrl(), i.toDataUrl()
assert.equal clipboard.readImage().toDataURL(), i.toDataURL()
describe 'clipboard.readText()', ->
it 'returns unicode string correctly', ->
@ -49,4 +49,4 @@ describe 'clipboard module', ->
clipboard.write {text: "test", html: '<b>Hi</b>', image: p}
assert.equal clipboard.readText(), text
assert.equal clipboard.readHtml(), markup
assert.equal clipboard.readImage().toDataUrl(), i.toDataUrl()
assert.equal clipboard.readImage().toDataURL(), i.toDataURL()

View file

@ -55,5 +55,5 @@ describe 'crash-reporter module', ->
pathname: path.join fixtures, 'api', 'crash.html'
search: "?port=#{port}"
if process.platform is 'darwin'
crashReporter.start {'submitUrl': 'http://127.0.0.1:' + port}
w.loadUrl url
crashReporter.start {'submitURL': 'http://127.0.0.1:' + port}
w.loadURL url

View file

@ -86,7 +86,7 @@ describe 'ipc module', ->
event.returnValue = null
w.destroy()
done()
w.loadUrl 'file://' + path.join(fixtures, 'api', 'send-sync-message.html')
w.loadURL 'file://' + path.join(fixtures, 'api', 'send-sync-message.html')
describe 'remote listeners', ->
it 'can be added and removed correctly', ->

View file

@ -23,7 +23,7 @@ describe 'session module', ->
server.listen 0, '127.0.0.1', ->
{port} = server.address()
w.loadUrl "#{url}:#{port}"
w.loadURL "#{url}:#{port}"
w.webContents.on 'did-finish-load', ->
w.webContents.session.cookies.get {url: url}, (error, list) ->
return done(error) if error
@ -64,7 +64,7 @@ describe 'session module', ->
ipcMain.removeAllListeners 'count'
assert not count
done()
w.loadUrl 'file://' + path.join(fixtures, 'api', 'localstorage.html')
w.loadURL 'file://' + path.join(fixtures, 'api', 'localstorage.html')
w.webContents.on 'did-finish-load', ->
options =
origin: "file://",
@ -91,7 +91,7 @@ describe 'session module', ->
downloadServer.listen 0, '127.0.0.1', ->
{port} = downloadServer.address()
ipcRenderer.sendSync 'set-download-option', false
w.loadUrl "#{url}:#{port}"
w.loadURL "#{url}:#{port}"
ipcRenderer.once 'download-done', (event, state, url, mimeType, receivedBytes, totalBytes, disposition, filename) ->
assert.equal state, 'completed'
assert.equal filename, 'mock.pdf'
@ -108,7 +108,7 @@ describe 'session module', ->
downloadServer.listen 0, '127.0.0.1', ->
{port} = downloadServer.address()
ipcRenderer.sendSync 'set-download-option', true
w.loadUrl "#{url}:#{port}/"
w.loadURL "#{url}:#{port}/"
ipcRenderer.once 'download-done', (event, state, url, mimeType, receivedBytes, totalBytes, disposition, filename) ->
assert.equal state, 'cancelled'
assert.equal filename, 'mock.pdf'

View file

@ -453,7 +453,7 @@ describe 'asar package', ->
ipcMain.once 'dirname', (event, dirname) ->
assert.equal dirname, path.dirname(p)
done()
w.loadUrl u
w.loadURL u
it 'loads script tag in html', (done) ->
after ->
@ -463,7 +463,7 @@ describe 'asar package', ->
w = new BrowserWindow(show: false, width: 400, height: 400)
p = path.resolve fixtures, 'asar', 'script.asar', 'index.html'
u = url.format protocol: 'file', slashed: true, pathname: p
w.loadUrl u
w.loadURL u
ipcMain.once 'ping', (event, message) ->
assert.equal message, 'pong'
done()

View file

@ -43,7 +43,7 @@ describe 'chromium feature', ->
w.webContents.on 'ipc-message', (event, args) ->
assert.deepEqual args, ['hidden', true]
done()
w.loadUrl url
w.loadURL url
describe 'navigator.webkitGetUserMedia', ->
it 'calls its callbacks', (done) ->
@ -96,7 +96,7 @@ describe 'chromium feature', ->
w.webContents.on 'ipc-message', (event, args) ->
assert.deepEqual args, ['opener', null]
done()
w.loadUrl url
w.loadURL url
it 'is not null for window opened by window.open', (done) ->
listener = (event) ->

View file

@ -6,7 +6,7 @@ var crashReporter = require('electron').crashReporter;
crashReporter.start({
productName: 'Zombies',
companyName: 'Umbrella Corporation',
submitUrl: 'http://127.0.0.1:' + port,
submitURL: 'http://127.0.0.1:' + port,
autoSubmit: true,
ignoreSystemCrashHandler: true,
extra: {

View file

@ -67,7 +67,7 @@ app.on('ready', function() {
javascript: true // Test whether web-preferences crashes.
},
});
window.loadUrl('file://' + __dirname + '/index.html');
window.loadURL('file://' + __dirname + '/index.html');
window.on('unresponsive', function() {
var chosen = dialog.showMessageBox(window, {
type: 'warning',
@ -88,7 +88,7 @@ app.on('ready', function() {
item.on('done', function(e, state) {
window.webContents.send('download-done',
state,
item.getUrl(),
item.getURL(),
item.getMimeType(),
item.getReceivedBytes(),
item.getTotalBytes(),