mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-27 09:10:12 +00:00
Use native URL API, instead of deprecated mw.Uri
Change-Id: Ia6bf82de647eb051f2719c13ceff5a2b07a3721f
This commit is contained in:
parent
f5ebd41ec9
commit
1b5116d668
|
@ -344,7 +344,7 @@
|
|||
"dependencies": [
|
||||
"ext.echo.api",
|
||||
"mediawiki.jqueryMsg",
|
||||
"mediawiki.Uri"
|
||||
"web2017-polyfills"
|
||||
],
|
||||
"messages": [
|
||||
"echo-badge-count",
|
||||
|
|
|
@ -9,19 +9,13 @@ mw.echo.config.maxPrioritizedActions = 2;
|
|||
*/
|
||||
function initDesktop() {
|
||||
'use strict';
|
||||
var uri;
|
||||
|
||||
// Remove ?markasread=XYZ from the URL
|
||||
try {
|
||||
uri = new mw.Uri();
|
||||
if ( uri.query.markasread !== undefined ) {
|
||||
delete uri.query.markasread;
|
||||
delete uri.query.markasreadwiki;
|
||||
window.history.replaceState( null, document.title, uri );
|
||||
}
|
||||
} catch ( e ) {
|
||||
// Catch problems when the URI is malformed (T261799)
|
||||
// e.g. #/media/Fitxer:Campbells_Soup_Cans_MOMA_reduced_80%.jpg
|
||||
var url = new URL( location.href );
|
||||
if ( url.searchParams.has( 'markasread' ) ) {
|
||||
url.searchParams.delete( 'markasread' );
|
||||
url.searchParams.delete( 'markasreadwiki' );
|
||||
history.replaceState( null, '', url );
|
||||
}
|
||||
|
||||
// Activate ooui
|
||||
|
|
Loading…
Reference in a new issue