Enable Vue Dev Tools

Forces Vue Dev Tools to work in production builds on any page.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name            Enable Vue Dev Tools
// @namespace       Enable Vue Dev Tools
// @match           *://*/*
// @grant           none
// @version         1.0
// @author          Alfredo3232
// @description     Forces Vue Dev Tools to work in production builds on any page.
// @license         GPL-3.0
// @homepageURL     https://github.com/Alfredo3232/webScripts
// @supportURL      https://github.com/Alfredo3232/webScripts/issues
// @compatible      firefox
// @compatible      librewolf
// ==/UserScript==

let activeVueTools = () => {
    // Find Vue 2
    let app = Array.from(document.querySelectorAll("*")).find((e) => e.__vue__).__vue__;

    if (app) {
        // Enable VueDevTools config
        const devtools = window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
        devtools.enabled = true;

        // Enable VueDevTools
        let VueApp = Object.getPrototypeOf(app).constructor;

        while (VueApp.super) {
            VueApp = VueApp.super;
        }

        VueApp.config.devtools = true;

        // Restart Extension
        devtools.emit("init", VueApp);

        return;
    }

    // Find Vue 3
    if (app === undefined || app === null) {
        app = Array.from(document.querySelectorAll("*")).find((e) => e.__vue_app__).__vue_app__;

        if (app === undefined || app === null) return;
    }

    //  Initialize and enable VueDevTools config
    const version = app.version;
    const devtools = window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
    devtools.enabled = true;

    // Restart Extension
    devtools.emit("app:init", app, version, {});

    return;
};

// Time out to prevent some pages from breaking
setTimeout(activeVueTools, 500);