Skip to content

Commit 31b71ee

Browse files
committed
feat: Warning message in console to avoid any self-xss from people (modified from miraheze/MirahezeMagic#665)
1 parent 442453c commit 31b71ee

4 files changed

Lines changed: 58 additions & 0 deletions

File tree

‎extension.json‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1886,6 +1886,14 @@
18861886
"wikioasismagic-fandomimport-unknown",
18871887
"wikioasismagic-fandomimport-waiting-dump-help"
18881888
]
1889+
},
1890+
"ext.wikioasismagic.consoleMessage": {
1891+
"packageFiles": [
1892+
"ext.wikioasismagic.consoleMessage.js"
1893+
],
1894+
"messages": [
1895+
"wikioasis-console-message"
1896+
]
18891897
}
18901898
},
18911899
"JobClasses": {

‎i18n/wikioasis/en.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
"settings-styling": "Styling",
108108
"settings-wikibase": "Wikibase",
109109
"specialpages-group-wikimanage": "Wiki management",
110+
"wikioasis-console-message": "Hold up! \n If you're being asked to copy-paste something here by anyone, there's a really high chance you are being scammed and may lose access to your WikiOasis account. \n\n Unless you know what you're doing, close this window.",
110111
"requestwiki-label-nsfw": "This wiki includes content that is not safe for work (NSFW)",
111112
"requestwiki-help-nsfw": "A wiki includes content that not safe for work (NSFW) if it includes graphic discussion or imagery of sex, gore or violence (either text or media content) or content which is otherwise inappropriate for those under the age of 18.",
112113
"requestwiki-label-nsfwtext": "Please give us more details about the type of NSFW content that your wiki will contain",

‎includes/HookHandlers/Main.php‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,8 @@ public function onUserGetRightsRemove( $user, &$rights ) {
415415
* @param Skin $skin
416416
*/
417417
public function onBeforePageDisplay( $out, $skin ): void {
418+
$out->addModules( 'ext.mirahezeMagic.consoleMessage' );
419+
418420
if ( MediaWikiServices::getInstance()
419421
->getExtensionRegistry()
420422
->isLoaded( 'SimpleBlogPage' )

‎modules/ext.wikioasismagic.consoleMessage.js‎

Lines changed: 47 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)