Private_Notes_4_Games

Makes it possible to write notes for games

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        Private_Notes_4_Games
// @namespace   DanWL
// @description Makes it possible to write notes for games
// @include     https://www.warzone.com/MultiPlayer?GameID=*
// @version     1.0.0.5
// @grant       none
// ==/UserScript==

var GameID = location.href.split(/\?GameID=/i)[1];

function addButton(text, onclick, classes, cssObj) {
    cssObj = cssObj || {position: 'absolute', bottom: '7%', left:'4%', 'z-index': 3}
    let button = document.createElement('button'), btnStyle = button.style
    document.body.appendChild(button)
    button.innerHTML = text
    button.onclick = onclick
    button.className = classes
    Object.keys(cssObj).forEach(key => btnStyle[key] = cssObj[key])
    return button
}

function duplicate(source) {
    var original = document.getElementById(source);
    var clone = original.cloneNode(true); // "deep" clone
   clone.id = "duplicater" + ++i; // there can only be one element with an ID
clone.innerHTML = 'CLONED'
    clone.onclick = duplicate; // event handlers are not cloned
    return clone;
}

function createUI()
{
	var multiplayer_dropdown = document.getElementById('#ujs_MenuBtn_btn');
	var GameNotesBtn = clone('ujs_MenuBtn_btn');

	multiplayer_dropdown.appendChild(GameNotesBtn);
}
createUI();