-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathuserscript.user.js
More file actions
29 lines (25 loc) · 1 KB
/
userscript.user.js
File metadata and controls
29 lines (25 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// ==UserScript==
// @name Blockheads - MessageBot
// @namespace http://portal.theblockheads.net/
// @version 0.2
// @description Adds links to launch the bot on world pages in the portal.
// @author Bibliofile
// @match http://portal.theblockheads.net/worlds/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
const container = document.querySelector('#tabs > ul');
function createLink(text, url) {
const li = container.appendChild(document.createElement('li'));
const link = li.appendChild(document.createElement('a'));
link.textContent = text;
link.addEventListener('click', function() {
const script = document.head.appendChild(document.createElement('script'));
script.src = url;
li.remove();
});
}
createLink('Bot 6.x', 'http://blockheadsfans.com/messagebot/bot/load');
createLink('Bot 7.x', 'https://blockheads-messagebot.github.io/Browser-Loader/bundle.js');
})();