Passer au contenu principal

Extensions

Scripts utilisateur

Les scripts utilisateurs ou userscripts (que nous appelons aussi "extensions") sont, en fait, des miniprogrammes écrits en JavaScript. Ils modifient ou élargissent les fonctionnalités d'un ou plusieurs sites web. De nombreux utilisateurs d'AdGuard sont peut-être déjà familiers avec des scripts utilisateur tels que AdGuard Assistant, Popup Blocker et AdGuard Extra.

Supported apps

AdGuard peut accroître considérablement les fonctionnalités des sites web en agissant comme un gestionnaire de scripts utilisateur. You can add your custom scripts or manage the existing ones in our three products: AdGuard for Windows, AdGuard for Android, and AdGuard for Mac.

Scripts AdGuard recommandés

Ces scripts utilisateur proviennent directement des développeurs AdGuard et nous pouvons garantir qu'ils sont efficaces et sûrs. For some of the userscripts developed by others that we consider good and reliable, scroll down to the next section. You can also find some of the popular websites with scripts below, but remember that whenever you download a userscript from an unknown source, you are exposing yourself to a certain risk, as some scripts may be harmful to your computer.

AdGuard Extra

Une extension qui bloque les publicités dans les cas difficiles où l'approche habituelle basée sur les filtres ne suffit pas. AdGuard Extra comes pre-installed in AdGuard standalone apps, except for the one for iOS, so you don't need to do anything to enable it. Cependant, si vous souhaitez l'utiliser avec l'extension de navigateur AdGuard ou tout autre bloqueur de publicités, vous devrez utiliser une extension supplémentaire. Learn more about this userscript and how to install it on GitHub.

AdGuard Extra

Bloqueur AdGuard de fenêtres pop-up

The name speaks for itself: it blocks popups — one of the most annoying types of ads on websites. Learn more about this userscript, its key features, and installation on GitHub.

AdGuard Popup Blocker

Assistant AdGuard (ancienne version)

This custom extension is designed to control filtering directly from the browser page (manual blocking, allowlisting, etc.).

note

This version of Assistant is legacy and there is no point in using it on new systems, as it has been replaced with the full-fledged Browser Assistant. However, the legacy Assistant may be useful if there is no Browser Assistant for your browser. If this is your case, you can learn how to install AdGuard Assistant on GitHub.

Désactiver AMP

Un script préinstallé uniquement dans AdGuard pour Android. Il désactive AMP (Accelerated Mobile Pages - pages mobiles accélérées) sur la page de résultats de recherche Google. Learn more about this userscript and how to install it on GitHub.

Disable AMP

Meilleurs choix en dehors d'AdGuard

These userscripts are not developed by AdGuard, and therefore we can't give a 100% guarantee that they are safe and/or work at all times. However, in our experience they deserve a recommendation because they've all earned their good reputation.

Don't track me Google

Ce script supprime la fonctionnalité de suivi de Google des liens dans les résultats de recherche Google. Il accélère le chargement des résultats de recherche et vous permet de cliquer ou d'appuyer avec le bouton droit pour copier l'URL du lien.

Its source code is available on GitHub. This userscript can be downloaded from GreasyFork and installed in any AdGuard CoreLibs-based app.

tinyShield

A userscript for people visiting Korean websites and some international websites. The tinyShield userscript blocks Ad-Shield ads and anti-adblocks. This userscript can be installed in AdGuard CoreLibs-based apps, Violentmonkey, Tampermonkey, and quoid/userscripts. Learn more about tinyShield and how to install it on GitHub.

Où trouver d'autres scripts utilisateur ?

Since userscripts are mainly created by enthusiasts, you should be cautious when installing them. Tout script provenant d'une source inconnue comporte un risque potentiel. Pourtant, il existe une grande variété de scripts intéressants qui, s’ils sont installés avec soin et de manière responsable, peuvent réellement rendre l’utilisation de certains sites web plus pratique.

Nous décrirons ici certains des catalogues de scripts utilisateur les plus populaires.

Userscript.Zone

Userscript.Zone is a website that allows searching for userscripts by entering a matching URL or domain. The website is easy to use and has a high level of credibility as only scripts from moderated pages are displayed.

Greasy Fork

Greasy Fork is a userscript catalog of Stylish creators. The scripts in this catalog are moderated, so their credibility is much higher.

OpenUserJS.org

OpenUserJS.org is an open-source userscript catalog written in nodeJS. It's not moderated, so keep an eye out for suspicious scripts.

Communauté

If you like the idea of customizing your browser with userscripts and have questions, you can ask them on one of these websites:

Développement

Demande de licence

If you are developing your own userscript and want to test how it works with AdGuard, you can request a license by filling in the form.

Compatibilité

Bloc de métadonnées

Propriétés prises en charge

@name
@namespace
@description
@version
@match
@include
@exclude
@grant
@connect
@require
@resource
@downloadURL
@updateURL
@supportURL
@homepageURL
@homepage
@website
@source
@run-at
@noframes
@icon
@iconURL
@defaulticon
@icon64
@icon64URL

Propriétés non prises en charge

Ces propriétés seront simplement ignorées par AdGuard.

@unwrap

Fonctions GM prises en charge

AdGuard prend en charge à la fois les anciennes fonctions GM_ et la nouvelle API GM4 qui utilisent l'objet GM.

Valeurs

note

Toutes les anciennes fonctions Greasemonkey répertoriées sont obsolètes mais toujours prises en charge.

GM.info / GM_info
GM.setValue / GM_setValue
GM.getValue / GM_getValue
GM.listValues / GM_listValues
GM.deleteValue / GM_deleteValue
GM.getResourceUrl / GM_getResourceURL
GM.setClipboard / GM_setClipboard
GM.xmlHttpRequest / GM_xmlhttpRequest
GM.openInTab / GM_openInTab
GM.notification
unsafeWindow
GM_getResourceText
GM_addStyle
GM_log

Here you can find more information about Greasemonkey API.

Example

// ==UserScript==
// @name Name as shown to the user when locale is english or unknown
// @name:ru Name as shown to the user when locale is russian
// @description Description as shown to the user when locale is english or unknown
// @description:ru Description as shown to the user when locale is russian
// @icon https://myhomepage.com/myuserscript.png
// @version 1.0.0.0
// @downloadURL https://dl.myhomepage.org/myuserscript.user.js
// @updateURL https://dl.myhomepage.org/myuserscript.meta.js
// @homepageURL https://myhomepage.com/myuserscript
// @include *
// @exclude *://website.com/*
// @resource https://myhomepage.com/myuserscript.css
// @require https://myhomepage.com/mylibrary.js
// @grant property:settings
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_deleteValue
// @grant GM_listValues
// @grant GM_getResourceText
// @grant GM_getResourceURL
// @grant GM_addStyle
// @grant GM_log
// @grant GM_setClipboard
// @grant GM_xmlhttpRequest
// @grant unsafeWindow
// @grant GM_info
// @grant GM_openInTab
// @grant GM_registerMenuCommand
// @run-at document-start
// ==/UserScript==
!function(){(
console.log("I am loaded!");
)}();

Styles utilisateur

Userstyles allow users to change the appearance of popular websites.

AdGuard has the option to upload or create your own userstyles. This is an advanced feature, so you will need some knowledge of HTML and CSS.

Supported apps

Currently, two AdGuard apps allow you to create and manage userstyles: AdGuard for Windows (v7.19 or later) and AdGuard for Mac (v2.16 or later). We also plan to implement this new feature in AdGuard v4.8 for Android in the nearest future.

This is an experimental feature, so if you encounter any problems while adding or creating a userstyle, please contact our support team at support@adguard.com.

How to set up a userstyle in AdGuard

You can download userstyles from various websites. One of the most popular userstyle websites is https://userstyles.world/, which we will use as an example for the following instructions on how to set up the userstyle in AdGuard.

  1. Follow the link above and choose the userstyle you like

  2. Click Copy next to the userstyle address

  3. Open AdGuard settings → Extensions

  4. Press the [+] button and paste the userstyle link

  5. C'est fait !

If you’re familiar with CSS rules, you can also create userstyles yourself.

note

We don’t support userstyles that contain @var or @advanced in the metadata. AdGuard also doesn’t support @preprocessor without the default value.

  1. Open AdGuard settings → Extensions

  2. Press the [+] button and choose the Create userstyle option. A new window will appear on your screen

  3. To create a userstyle, first write the title with metadata, for example

    /* ==UserStyle==
    @name New userstyle
    @version 1.0
    ==/UserStyle== */
  4. Write the CSS part after the meta data. AdGuard supports website domain names matching (@-moz-document domain(…), …). For example:

    body {
    background: gray;
    }

    Or:

    @-moz-document domain('example.org'),
    domain('example.net'),
    domain('example.com') body {
    background: gray;
    }
  5. Once you’re finished, press Save and Close. Your new userstyle has been successfully added to AdGuard

Example

/* ==UserStyle==
@name Example userstyle
@namespace https://example.org/userstyle
@homepageURL https://example.org/userstyle
@version 1.0.0
@license Other
@description This is an example
@author example
@preprocessor default
==/UserStyle== */
@-moz-document regexp("https?\:\/\/(www\.)?example\.(org|com).*") {
body {
background-color: #000000 !important;
}
}