Private_Notes_4_Games

Makes it possible to write notes for games

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==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();