-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Native userstyles support in AdGuard #1367
Comments
Example Userstyle Code: @-moz-document domain("r4p3.net"), domain("rape.ru.com") {
/* Global dark style - changes everything to DARK (https://userstyles.org/styles/31267/)*/
* {
color: #999;
}
body {
background: transparent !important
}
@-moz-document domain("r4p3.net"), domain("rape.ru.com") {
/* USER SETTINGS */
/* start anonym_avatar_all */
/*[[anonym_avatar_all]]*/
/* anonym_avatar_all end */
/* start anonym_name_all */
/*[[anonym_name_all]]*/
/* anonym_name_all end */
/* start avatar_local */
/*[[avatar_local]]*/
/* avatar_local end */
/* start unixtime */
/*[[unixtime]]*/
/* unixtime end */
/* start names_team_color */
/*[[names_team_color]]*/
/* names_team_color end */
} |
Example Userstyle Userscript Code: // ==UserScript==
// @name Dark R4P3
// @namespace http://userstyles.org
// @description This modifies the r4p3.net forum to become a dark look and saves your eyelight :)
// @author Bluscream
// @homepage https://userstyles.org/styles/120607
// @include http://r4p3.net/*
// @include https://r4p3.net/*
// @include http://*.r4p3.net/*
// @include https://*.r4p3.net/*
// @include http://rape.ru.com/*
// @include https://rape.ru.com/*
// @include http://*.rape.ru.com/*
// @include https://*.rape.ru.com/*
// @include http://r4p3.net/*
// @include https://r4p3.net/*
// @include http://*.r4p3.net/*
// @include https://*.r4p3.net/*
// @include http://rape.ru.com/*
// @include https://rape.ru.com/*
// @include http://*.rape.ru.com/*
// @include https://*.rape.ru.com/*
// @include http://r4p3.net/*
// @include https://r4p3.net/*
// @include http://*.r4p3.net/*
// @include https://*.r4p3.net/*
// @include http://rape.ru.com/*
// @include https://rape.ru.com/*
// @include http://*.rape.ru.com/*
// @include https://*.rape.ru.com/*
// @include http://r4p3.net/*
// @include https://r4p3.net/*
// @include http://*.r4p3.net/*
// @include https://*.r4p3.net/*
// @include http://rape.ru.com/*
// @include https://rape.ru.com/*
// @include http://*.rape.ru.com/*
// @include https://*.rape.ru.com/*
// @include http://r4p3.net/*
// @include https://r4p3.net/*
// @include http://*.r4p3.net/*
// @include https://*.r4p3.net/*
// @include http://rape.ru.com/*
// @include https://rape.ru.com/*
// @include http://*.rape.ru.com/*
// @include https://*.rape.ru.com/*
// @include http://r4p3.net/*
// @include https://r4p3.net/*
// @include http://*.r4p3.net/*
// @include https://*.r4p3.net/*
// @include http://rape.ru.com/*
// @include https://rape.ru.com/*
// @include http://*.rape.ru.com/*
// @include https://*.rape.ru.com/*
// @run-at document-start
// @version 0.20160221115530
// ==/UserScript==
(function() {var css = "";
if (false || (document.domain == "r4p3.net" || document.domain.substring(document.domain.indexOf(".r4p3.net") + 1) == "r4p3.net") || (document.domain == "rape.ru.com" || document.domain.substring(document.domain.indexOf(".rape.ru.com") + 1) == "rape.ru.com"))
css += [
"/* Global dark style - changes everything to DARK (https://userstyles.org/styles/31267/)*/",
"* {",
" color: #999;",
"}",
"body {",
" background: transparent !important",
"}",
].join("\n");
if (false || (document.domain == "r4p3.net" || document.domain.substring(document.domain.indexOf(".r4p3.net") + 1) == "r4p3.net") || (document.domain == "rape.ru.com" || document.domain.substring(document.domain.indexOf(".rape.ru.com") + 1) == "rape.ru.com"))
css += [
"/* USER SETTINGS */",
"",
"/* start anonym_avatar_all */",
"",
"/* anonym_avatar_all end */",
"",
"/* start anonym_name_all */",
"",
"/* anonym_name_all end */",
"",
"/* start avatar_local */",
"",
"/* avatar_local end */",
"",
"/* start unixtime */",
"",
"/* unixtime end */",
"",
"/* start names_team_color */",
"a[href=\"members/bluscream.53/\"].username:not(.visitorPanel) { color:cyan !important; }",
"a[href=\"members/supervisor.10/\"].username:not(.visitorPanel) { color:rgb(210, 61, 25) !important }",
"a[href=\"members/asphyxia.1/\"].username:not(.visitorPanel) { color:red !important }",
"/* names_team_color end */"
].join("\n");
if (typeof GM_addStyle != "undefined") {
GM_addStyle(css);
} else if (typeof PRO_addStyle != "undefined") {
PRO_addStyle(css);
} else if (typeof addStyle != "undefined") {
addStyle(css);
} else {
var node = document.createElement("style");
node.type = "text/css";
node.appendChild(document.createTextNode(css));
var heads = document.getElementsByTagName("head");
if (heads.length > 0) {
heads[0].appendChild(node);
} else {
// no head yet, stick it whereever
document.documentElement.appendChild(node);
}
}
})(); |
Example Userstyle Settings: Docs https://justpaste.it/102n2 ( Don't ask why it looks so shitty x) |
I agree that we'd better distinguish userstyles from userscripts. |
Any news on this? I'm hyped :DDD |
Planned on v6.3, so it'll take some time |
Just came looking to see if this was something you guys were working on. I'm frustrated with the takeover of Stylish and have removed it from my browsers. But, userstyles as currently implemented in Adgaurd via userscripts only works correctly about half the time. Can't wait for this to move forward and kill all the birds with a single AdGuard stone. :-D |
@GollyJer could you please give an example of a userstyle not working with AG (when you convert it to a userscript)? I'd just like to understand what's the problem with it. |
Hi @ameshkov. Here are a couple.
|
@GollyJer apparently, the issue is with the style-to-script converter. The userscripts generated by it add |
Here is my version of What's done:
|
Meanwhile, @seanl-adg has made a proper userstyle->userjs converter: Code: We should reuse this code in order to add native userstyles support. |
Also, I've reported the issue to userstyles.org (and suggested a possible solution). Should've reported it back then when we first discussed it. |
@ameshkov I wanted to revisit this because I still can't get many userstyles to work with AdGuard for Windows. It works perfectly in Stylus but doesn't do anything when added to AdGuard via the Would love these styles to work across all my browsers. 😜 Thanks! |
Pinging this thread again... now that Adguard for Android has Extensions support it would be AWESOME to also apply themes/styles via Adguard Extensions. |
Yeah, time to resurrect this indeed, thanks for pinging us |
Moved to CoreLibs: |
First, yes i know you can get a userscript version of any userstyle on userstyles.org and it's not hard to port any css to a userscript, but it isn't recommended because it impacts the performance a bit per style then.
I would love to see a new Tab in the settings called
Styles
orUserstyles
where you can add any *.css file and AdGuard implements the css directly into the website using already existing function.You could even go a step further and implement the userstyle's settings in the "Install Userstyle" dialog ♥
It would also clean up the
Extensions
tab a lot if it only shows the scripts :)The text was updated successfully, but these errors were encountered: