IsQuestCompleted

Simple macro that check you completed that quest before.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         IsQuestCompleted
// @namespace    http://tampermonkey.net/
// @version      3.0
// @description  Simple macro that check you completed that quest before.
// @author       Przemekb88 / Yalahari
// @license      MIT
// @match        https://www.wowhead.com/quest=*
// @match        https://wowpedia.fandom.com/wiki/*
// @grant        none
// ==/UserScript==


var host = window.location.hostname
var url = window.location.href
if (host === 'wowpedia.fandom.com') {
    url = document.querySelector('.elinks .wowhead').firstChild.href
}

var page = url.substring(url.lastIndexOf('quest=') + 6)
var result = page.split('/')

var button = document.createElement('button')

button.onclick = function() {
    navigator.clipboard.writeText('/script print(IsQuestFlaggedCompleted('+result[0]+'))')
    button.textContent = 'Copied'
    setTimeout(function() {
        button.textContent = 'Is quest completed?'
    }, 3000)
}
button.textContent = 'Is quest completed?'

if (host === 'wowpedia.fandom.com') {
    var tr = document.createElement('tr')
    var th = document.createElement('th')
    th.setAttribute('scope', 'row')
    th.style.textAlign = 'left'
    th.style.backgroundColor = 'transparent'
    th.innerHTML = 'Check'
    tr.appendChild(th)
    tr.appendChild(button)
    var questbox = document.querySelector('.infobox.darktable.questbox')
    questbox.appendChild(tr)
} else {
    var node = document.createElement('li')
    node.appendChild(button)
    var myList = document.getElementById('infobox-contents-0').getElementsByTagName('ul')[0]
    myList.appendChild(node)
}