Back btn

back history

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

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το 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         Back btn
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  back history
// @author       You
// @match         *://*/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=greasyfork.org
// @grant        none
// @license      none
// ==/UserScript==

(function() {

let css=`
.buttonForBack{
    position: fixed;
    bottom: 100px;
    right: 50px;
    border: none;
    border-radius: 50px;
    height: 40px;
    width: 40px;
    opacity: 0.75;
    background-color: rgba(18, 17, 17, 1);
}

.circleForBack{
    background-color: rgb(93, 85, 85,0.5);
    border: 2px solid #7B8471;
    height: 50px;
    width: 50px;
    bottom: 93px;
    right: 43px;
}

.newIn{
    border: 2.5px solid #3CB3E4;
    transform: scale(0.95);
}

.newOut{
    background-color: #3c4143;
    transform: scale(0.95);
}
`

let html=`<div class="container"></div>
<div class="buttonForBack circleForBack "></div>
<button class="buttonForBack newOut"></button>
`

let Inject=document.createElement('div')
Inject.innerHTML=html
document.body.appendChild(Inject)


let Putcss=document.createElement('style')
Putcss.innerHTML=css
document.head.appendChild(Putcss)

const inner=document.querySelector('button.buttonForBack')
const outside=document.querySelector('.circleForBack')

inner.addEventListener('click',() => {
    outside.classList.add('newOut')
    inner.classList.add('newIn')

    setTimeout(() => {
        inner.classList.remove('newIn')
        outside.classList.remove('newOut')
},95)

    history.back();
})


})();