mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1374672 - Use documentURI instead of baseURI. r=automatedtester
baseURI isn't actually we have to check for to get the current documents URI. Therefore documentURI exists. MozReview-Commit-ID: CDhOZ8lU2qJ --HG-- extra : rebase_source : c53f79468a7d319bd5e7aa40338fce0ca7299bd4
This commit is contained in:
parent
2108ee3e4e
commit
2ae312826e
@ -1629,11 +1629,11 @@ GeckoDriver.prototype.switchToFrame = function* (cmd, resp) {
|
||||
if (win.document.readyState == "complete") {
|
||||
return;
|
||||
} else if (win.document.readyState == "interactive") {
|
||||
let baseURI = win.document.baseURI;
|
||||
if (baseURI.startsWith("about:certerror")) {
|
||||
let documentURI = win.document.documentURI;
|
||||
if (documentURI.startsWith("about:certerror")) {
|
||||
throw new InsecureCertificateError();
|
||||
} else if (otherErrorsExpr.exec(win.document.baseURI)) {
|
||||
throw new UnknownError("Error loading page");
|
||||
} else if (otherErrorsExpr.exec(documentURI)) {
|
||||
throw new UnknownError("Reached error page: " + documentURI);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -222,7 +222,7 @@ var loadListener = {
|
||||
* Callback for registered DOM events.
|
||||
*/
|
||||
handleEvent(event) {
|
||||
let location = event.target.baseURI || event.target.location.href;
|
||||
let location = event.target.documentURI || event.target.location.href;
|
||||
logger.debug(`Received DOM event "${event.type}" for "${location}"`);
|
||||
|
||||
switch (event.type) {
|
||||
@ -255,21 +255,21 @@ var loadListener = {
|
||||
break;
|
||||
|
||||
case "DOMContentLoaded":
|
||||
if (event.target.baseURI.startsWith("about:certerror")) {
|
||||
if (event.target.documentURI.startsWith("about:certerror")) {
|
||||
this.stop();
|
||||
sendError(new InsecureCertificateError(), this.command_id);
|
||||
|
||||
} else if (/about:.*(error)\?/.exec(event.target.baseURI)) {
|
||||
} else if (/about:.*(error)\?/.exec(event.target.documentURI)) {
|
||||
this.stop();
|
||||
sendError(new UnknownError("Reached error page: " +
|
||||
event.target.baseURI), this.command_id);
|
||||
event.target.documentURI), this.command_id);
|
||||
|
||||
// Return early with a page load strategy of eager, and also
|
||||
// special-case about:blocked pages which should be treated as
|
||||
// non-error pages but do not raise a pageshow event.
|
||||
} else if ((capabilities.get("pageLoadStrategy") ===
|
||||
session.PageLoadStrategy.Eager) ||
|
||||
/about:blocked\?/.exec(event.target.baseURI)) {
|
||||
/about:blocked\?/.exec(event.target.documentURI)) {
|
||||
this.stop();
|
||||
sendOk(this.command_id);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user