mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 07:15:46 +00:00
Bug 353933 - Make OnOverlink use CreateExposableURI. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D59428 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
c114029715
commit
54949e252f
@ -12445,8 +12445,12 @@ nsresult nsDocShell::OnOverLink(nsIContent* aContent, nsIURI* aURI,
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIURI> exposableURI;
|
||||
rv = sURIFixup->CreateExposableURI(aURI, getter_AddRefs(exposableURI));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsAutoCString spec;
|
||||
rv = aURI->GetDisplaySpec(spec);
|
||||
rv = exposableURI->GetDisplaySpec(spec);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
NS_ConvertUTF8toUTF16 uStr(spec);
|
||||
|
@ -123,6 +123,9 @@ support-files =
|
||||
[browser_multiple_pushState.js]
|
||||
[browser_onbeforeunload_navigation.js]
|
||||
skip-if = (os == 'win' && !debug) # bug 1300351
|
||||
[browser_overlink.js]
|
||||
support-files =
|
||||
overlink_test.html
|
||||
[browser_search_notification.js]
|
||||
[browser_tab_touch_events.js]
|
||||
[browser_timelineMarkers-01.js]
|
||||
|
27
docshell/test/browser/browser_overlink.js
Normal file
27
docshell/test/browser/browser_overlink.js
Normal file
@ -0,0 +1,27 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
const TEST_PATH = getRootDirectory(gTestPath).replace(
|
||||
"chrome://mochitests/content",
|
||||
"https://example.com"
|
||||
);
|
||||
|
||||
add_task(async function test_stripAuthCredentials() {
|
||||
await BrowserTestUtils.withNewTab(
|
||||
TEST_PATH + "overlink_test.html",
|
||||
async function(browser) {
|
||||
await SpecialPowers.spawn(browser, [], function() {
|
||||
content.document.getElementById("link").focus();
|
||||
});
|
||||
|
||||
await TestUtils.waitForCondition(
|
||||
() => XULBrowserWindow.overLink == "https://example.com",
|
||||
"Overlink should be missing auth credentials"
|
||||
);
|
||||
|
||||
ok(true, "Test successful");
|
||||
}
|
||||
);
|
||||
});
|
7
docshell/test/browser/overlink_test.html
Normal file
7
docshell/test/browser/overlink_test.html
Normal file
@ -0,0 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head> <meta charset="utf-8"> </head>
|
||||
<body>
|
||||
<a id="link" href="https://user:password@example.com">Link</a>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user