зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1257804 - avoid copy-pasting about:reader and copy-paste the URL instead, r=dolske
MozReview-Commit-ID: IzBVSG4ZUte --HG-- extra : rebase_source : 7d752e42ae22902e4a45e3d62b56f1af624c1087
This commit is contained in:
Родитель
5fca22901b
Коммит
8da1680aec
|
@ -60,6 +60,15 @@ add_task(function* test_reader_button() {
|
|||
is(gURLBar.value, readerUrl, "gURLBar value is about:reader URL");
|
||||
is(gURLBar.textValue, url.substring("http://".length), "gURLBar is displaying original article URL");
|
||||
|
||||
// Check selected value for URL bar
|
||||
yield new Promise((resolve, reject) => {
|
||||
waitForClipboard(url, function () {
|
||||
gURLBar.focus();
|
||||
gURLBar.select();
|
||||
goDoCommand("cmd_copy");
|
||||
}, resolve, reject);
|
||||
});
|
||||
|
||||
// Switch page back out of reader mode.
|
||||
readerButton.click();
|
||||
yield promiseTabLoadEvent(tab);
|
||||
|
|
|
@ -612,6 +612,12 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|||
return selectedVal;
|
||||
}
|
||||
|
||||
// Avoid copying 'about:reader?url=', and always provide the original URI:
|
||||
let readerOriginalURL = ReaderMode.getOriginalUrl(uri.spec);
|
||||
if (readerOriginalURL) {
|
||||
uri = uriFixup.createFixupURI(readerOriginalURL, Ci.nsIURIFixup.FIXUP_FLAG_NONE);
|
||||
}
|
||||
|
||||
// Only copy exposable URIs
|
||||
try {
|
||||
uri = uriFixup.createExposableURI(uri);
|
||||
|
|
Загрузка…
Ссылка в новой задаче