jenkins-bot has submitted this change and it was merged.
Change subject: mw.Target: Hopefully fix plugin garbage removal code
......................................................................
mw.Target: Hopefully fix plugin garbage removal code
Follows-up 0547d8c8.
It's still very difficult to test whether this code works, but
doing $( newDoc ).remove( 'selector1' ).remove( 'selector2' )...
demonstrably doesn't work, because 1) the selector passed to remove()
filters the collection, it doesn't descend into it, and 2) remove()
returns the collection of removed items, so chaining it doesn't work.
Instead, use $( newDoc ).find( 'selector1, selector2, ...' ).remove();
Also normalise selectors.
Change-Id: I97f3b28c4d5120f08e5d7fbf4598ddc0c01d4ecf
---
M modules/ve-mw/init/ve.init.mw.Target.js
1 file changed, 13 insertions(+), 10 deletions(-)
Approvals:
Alex Monk: Looks good to me, approved
jenkins-bot: Verified
diff --git a/modules/ve-mw/init/ve.init.mw.Target.js
b/modules/ve-mw/init/ve.init.mw.Target.js
index 9a3f9db..715e477 100644
--- a/modules/ve-mw/init/ve.init.mw.Target.js
+++ b/modules/ve-mw/init/ve.init.mw.Target.js
@@ -984,16 +984,19 @@
copyAttributes( oldDoc.head, newDoc.head );
copyAttributes( oldDoc.body, newDoc.body );
$( newDoc )
- .remove( 'div[id = myEventWatcherDiv]' ) // Bug 51423
- .remove( 'embed[type = "application/iodbc"]' ) // Bug 51521
- .remove( 'embed[type = "application/x-datavault"]' ) // Bug
52791
- .remove( 'script[id = FoxLingoJs]' ) // Bug 52884
- .remove( 'style[id = _clearly_component__css]' ) // Bug 53252
- .remove( 'div[id = sendToInstapaperResults]' ) // Bug 61776
- .remove( 'embed[id ^= xunlei_com_thunder_helper_plugin]' ) //
Bug 63121
- .remove( 'object[type = cosymantecnisbfw],
script[id=NortonInternetSecurityBF]' ) // Bug 63229
- .remove( 'div[id = kloutify]' ) // Bug 67006
- .remove( 'div[id ^= mittoHidden]' ); // Bug 68900#c1
+ .find(
+ 'div[id="myEventWatcherDiv"], ' + // Bug 51423
+ 'embed[type="application/iodbc"], ' + // Bug 51521
+ 'embed[type="application/x-datavault"], ' + // Bug 52791
+ 'script[id="FoxLingoJs"], ' + // Bug 52884
+ 'style[id="_clearly_component__css"], ' + // Bug 53252
+ 'div[id="sendToInstapaperResults"], ' + // Bug 61776
+ 'embed[id^="xunlei_com_thunder_helper_plugin"], ' + //
Bug 63121
+ 'object[type="cosymantecnisbfw"],
script[id="NortonInternetSecurityBF"], ' + // Bug 63229
+ 'div[id="kloutify"], ' + // Bug 67006
+ 'div[id^="mittoHidden"]' // Bug 68900#c1
+ )
+ .remove();
// Add doctype manually
return '<!doctype html>' + ve.serializeXhtml( newDoc );
};
--
To view, visit https://gerrit.wikimedia.org/r/191212
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I97f3b28c4d5120f08e5d7fbf4598ddc0c01d4ecf
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Catrope <[email protected]>
Gerrit-Reviewer: Alex Monk <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits