Sandbox: Difference between revisions
From Hidden Mickey Wiki
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
<script> | <script> | ||
(function() { | (function() { | ||
// | // Only run on Sandbox page | ||
if (mw.config.get('wgPageName') === 'Sandbox') { | |||
if ( | |||
// | // Detect Mac desktop | ||
var platform = navigator.platform.toLowerCase(); | |||
if (platform.indexOf('mac') !== -1) { | |||
// Show an alert | |||
alert("Hello World – Mac desktop detected!"); | |||
// Add a visible message on the page | |||
var msg = document.createElement('div'); | |||
msg.textContent = "Hello World – Mac desktop detected!"; | |||
msg.style.color = 'red'; | |||
msg.style.fontWeight = 'bold'; | |||
msg.style.fontSize = '16px'; | |||
msg.style.margin = '10px 0'; | |||
document.body.prepend(msg); | |||
} | |||
} | } | ||
})(); | })(); | ||
</script> | </script> | ||
Revision as of 09:49, 2 October 2025
<script> (function() {
// Only run on Sandbox page
if (mw.config.get('wgPageName') === 'Sandbox') {
// Detect Mac desktop
var platform = navigator.platform.toLowerCase();
if (platform.indexOf('mac') !== -1) {
// Show an alert
alert("Hello World – Mac desktop detected!");
// Add a visible message on the page
var msg = document.createElement('div');
msg.textContent = "Hello World – Mac desktop detected!";
msg.style.color = 'red';
msg.style.fontWeight = 'bold';
msg.style.fontSize = '16px';
msg.style.margin = '10px 0';
document.body.prepend(msg);
} }
})(); </script>