VSCode - Insiders Install Button

Adds an install in vscode-insiders button on vscode marketplace - 11/16/2022, 12:19:37 PM

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το 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        VSCode - Insiders Install Button
// @namespace   Violentmonkey Scripts
// @match       https://marketplace.visualstudio.com/items
// @grant       none
// @version     1.0
// @author      MohamedBechirMejri
// @description Adds an install in vscode-insiders button on vscode marketplace - 11/16/2022, 12:19:37 PM
// ==/UserScript==

const extensionName = document.getElementById('FQN').value
const newInstallButton = document.createElement('a')
const buttonsContainer = document.querySelector('.ux-item-action')

newInstallButton.className = 'ms-Button-label ms-Button ux-button install ms-Button--default root-39'
newInstallButton.innerText = 'Install in VSCode - Insiders'
newInstallButton.href = 'vscode-insiders:extension/' + extensionName

newInstallButton.style.backgroundColor = '#0076b8'
newInstallButton.style.fontWeight = 'bold'
newInstallButton.style.display = 'flex'
newInstallButton.style.width = 'max-content'
newInstallButton.style.alignItems = 'center'
newInstallButton.style.marginTop = '0.5rem'

newInstallButton.addEventListener('mouseenter', e => {
  e.target.style.backgroundColor = '#004070'
})

newInstallButton.addEventListener('mouseleave', e => {
  e.target.style.backgroundColor = '#0076b8'
})


buttonsContainer.append(newInstallButton)