mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 941136 - getUrl not matching webdriver command getCurrentUrl. r=dburns
This commit is contained in:
parent
3a75aac6e3
commit
7c1599c82c
@ -870,10 +870,20 @@ class Marionette(object):
|
||||
return response
|
||||
|
||||
def get_url(self):
|
||||
'''
|
||||
Returns the url of the active page in the browser.
|
||||
'''
|
||||
response = self._send_message('getUrl', 'value')
|
||||
"""Get a string representing the current URL.
|
||||
|
||||
On Desktop this returns a string representation of the URL of
|
||||
the current top level browsing context. This is equivalent to
|
||||
document.location.href.
|
||||
|
||||
When in the context of the chrome, this returns the canonical
|
||||
URL of the current resource.
|
||||
|
||||
:returns: string representation of URL
|
||||
|
||||
"""
|
||||
|
||||
response = self._send_message("getCurrentUrl", "value")
|
||||
return response
|
||||
|
||||
def get_window_type(self):
|
||||
|
@ -131,7 +131,7 @@ function startListeners() {
|
||||
addMessageListenerId("Marionette:actionChain", actionChain);
|
||||
addMessageListenerId("Marionette:multiAction", multiAction);
|
||||
addMessageListenerId("Marionette:goUrl", goUrl);
|
||||
addMessageListenerId("Marionette:getUrl", getUrl);
|
||||
addMessageListenerId("Marionette:getCurrentUrl", getCurrentUrl);
|
||||
addMessageListenerId("Marionette:getTitle", getTitle);
|
||||
addMessageListenerId("Marionette:getPageSource", getPageSource);
|
||||
addMessageListenerId("Marionette:goBack", goBack);
|
||||
@ -234,7 +234,7 @@ function deleteSession(msg) {
|
||||
removeMessageListenerId("Marionette:goUrl", goUrl);
|
||||
removeMessageListenerId("Marionette:getTitle", getTitle);
|
||||
removeMessageListenerId("Marionette:getPageSource", getPageSource);
|
||||
removeMessageListenerId("Marionette:getUrl", getUrl);
|
||||
removeMessageListenerId("Marionette:getCurrentUrl", getCurrentUrl);
|
||||
removeMessageListenerId("Marionette:goBack", goBack);
|
||||
removeMessageListenerId("Marionette:goForward", goForward);
|
||||
removeMessageListenerId("Marionette:refresh", refresh);
|
||||
@ -1237,9 +1237,9 @@ function goUrl(msg) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current URI
|
||||
* Get URL of the top level browsing context.
|
||||
*/
|
||||
function getUrl(msg) {
|
||||
function getCurrentUrl(msg) {
|
||||
sendResponse({value: curFrame.location.href}, msg.json.command_id);
|
||||
}
|
||||
|
||||
|
@ -1079,15 +1079,22 @@ MarionetteServerConnection.prototype = {
|
||||
},
|
||||
|
||||
/**
|
||||
* Gets current url
|
||||
* Get a string representing the current URL.
|
||||
*
|
||||
* On Desktop this returns a string representation of the URL of the
|
||||
* current top level browsing context. This is equivalent to
|
||||
* document.location.href.
|
||||
*
|
||||
* When in the context of the chrome, this returns the canonical URL
|
||||
* of the current resource.
|
||||
*/
|
||||
getUrl: function MDA_getUrl() {
|
||||
getCurrentUrl: function MDA_getCurrentUrl() {
|
||||
this.command_id = this.getCommandId();
|
||||
if (this.context == "chrome") {
|
||||
this.sendResponse(this.getCurrentWindow().location.href, this.command_id);
|
||||
}
|
||||
else {
|
||||
this.sendAsync("getUrl", {}, this.command_id);
|
||||
this.sendAsync("getCurrentUrl", {}, this.command_id);
|
||||
}
|
||||
},
|
||||
|
||||
@ -2375,7 +2382,8 @@ MarionetteServerConnection.prototype.requestTypes = {
|
||||
"getWindowType": MarionetteServerConnection.prototype.getWindowType,
|
||||
"getPageSource": MarionetteServerConnection.prototype.getPageSource,
|
||||
"goUrl": MarionetteServerConnection.prototype.goUrl,
|
||||
"getUrl": MarionetteServerConnection.prototype.getUrl,
|
||||
"getCurrentUrl": MarionetteServerConnection.prototype.getCurrentUrl,
|
||||
"getUrl": MarionetteServerConnection.prototype.getCurrentUrl, // deprecated
|
||||
"goBack": MarionetteServerConnection.prototype.goBack,
|
||||
"goForward": MarionetteServerConnection.prototype.goForward,
|
||||
"refresh": MarionetteServerConnection.prototype.refresh,
|
||||
|
Loading…
Reference in New Issue
Block a user