mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-23 16:06:53 +00:00
Permalink copying: use currentTarget to avoid conflicts with userscripts
Bug: T368701 Change-Id: I70b1cbf8aaf917ed843f003eec7bbd61db39ecc7
This commit is contained in:
parent
12bca79877
commit
cd39c267b5
|
@ -1,7 +1,9 @@
|
|||
function init( $pageContainer ) {
|
||||
$pageContainer.find( '.ext-discussiontools-init-timestamplink' ).on( 'click', ( e ) => {
|
||||
// Try to percent-decode the URL, so that non-Latin characters don't look so ugly (T357021)
|
||||
let link = e.target.href;
|
||||
// Use currentTarget rather than target to avoid conflicts with userscripts that do their
|
||||
// own timestamp-wrapping. (T368701)
|
||||
let link = e.currentTarget.href;
|
||||
try {
|
||||
// decodeURI() may throw
|
||||
const decodedLink = decodeURI( e.target.href );
|
||||
|
|
Loading…
Reference in a new issue