Docs Redirect

Asks to switch to user 1 when using Google Docs with user 0

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         Docs Redirect
// @version      0.2
// @description  Asks to switch to user 1 when using Google Docs with user 0
// @author       pooroll
// @include https://docs.google.com/document/u/*
// @namespace https://greasyfork.org/users/157849
// ==/UserScript==

(function() {
    'use strict';
window.addEventListener ("load", LocalMain, false);

function LocalMain () {
    setTimeout(function() {
        var path0 = window.location.pathname;
        var path1 = path0.substring(0, 13);
        if (path1 === "/document/u/0"){
            //var pathle = path0.length - 1;
            //var path2 = path0.substring(15, pathle);
            //alert(path2);
            var r = confirm("Redirect to Account 2?");
            if (r === true) {
                window.location.replace("https://docs.google.com/document/u/1/");
            } else {
            }
        }
    }, 0);
}

    // Your code here...
})();