Change User-Agent (for future).

No verified bots (v BOT).

Change side to top bar in settings.

Some settings were redesigned.
This commit is contained in:
Er2 2022-03-26 20:48:55 +03:00
parent 957f5b091f
commit 57f82d613b
8 changed files with 166 additions and 30 deletions

View file

@ -6,6 +6,7 @@
@import "src/hide";
@import "src/show";
@import "src/dimmer";
@import "src/mobile";
@import "src/profile";
@import "src/people";
@import "src/fixes";

View file

@ -4,15 +4,27 @@
*/
// Disable CSP
function onHeaders(det) {
for (var i = 0; i < det.responseHeaders.length; i++) {
if (det.responseHeaders[i].name.toLowerCase() == 'content-security-policy'
|| det.responseHeaders[i].name.toLowerCase() == 'content-security-policy-report-only'
) det.responseHeaders[i].value = '';
}
return { responseHeaders: det.responseHeaders };
}
chrome.webRequest.onHeadersReceived.addListener(
onHeaders, {urls: ['<all_urls>']}, ['blocking', 'responseHeaders']
function(det) {
for (let head of det.responseHeaders) {
let n = head.name.toLowerCase();
if (n == 'content-security-policy' || n == 'content-security-policy-report-only'
) head.value = '';
}
return { responseHeaders: det.responseHeaders };
},
{urls: ['<all_urls>']}, ['blocking', 'responseHeaders']
);
chrome.webRequest.onBeforeSendHeaders.addListener(
function(det) {
for (let head of det.requestHeaders) {
let n = head.name.toLowerCase();
if (n == 'user-agent')
head.value = 'DisKort/1.0 (Linux) Firefox/99.0';
}
return { requestHeaders: det.requestHeaders };
},
{urls: ['<all_urls>']}, ['blocking', 'requestHeaders']
);

View file

@ -38,3 +38,26 @@ div[class*="templatesList-"] {
// fix tempates list (it was removed)
height: 128px;
}
// Fix positioning
div[class^="toolsContainer-"] { // in settings
position: fixed !important;
right: 21px;
padding: 0;
margin-top: 60px;
border-radius: 16px;
& > div {
position: unset !important;
div[class^="container"] > * {
background-color: var(--background-nested-floating);
}
}
}
div[class^="contentContainer-"] div[class*="stickyHeader-"] {
padding-left: 0;
padding-right: 0;
margin: 0;
}

View file

@ -53,6 +53,7 @@ div[class^="welcomeCTA-"], // wave to say hi on server
div[role="separator"]:not([id$="new-messages-bar"]), // aren't needed
// Profile
[class^="botTagVerified-"],
[class^="bannerContainer-"],
[class*="banner-"],
@ -61,13 +62,6 @@ div[class^="keybind-"], // true must know it!
[class*="socialLink-"], // in change log
div[class^="socialLinks-"], // in settings at bottom
// Tabs
div[aria-controls*="nitro"],
div[aria-controls="library-inventory-tab"],
div[aria-controls="subscriptions-tab"],
div[aria-controls="billing-tab"],
div[aria-controls^="hypesquad"],
// Member list
[class^="membersGroup-"], // groups (roles)

View file

@ -12,7 +12,6 @@
[class^="layer-"] { padding: 0; margin: auto; }
[class^="layer-"] > [class^="container-"],
[class^="standardSidebarView-"] { overflow-x: scroll; }
[class^="base-"], [class^="contentRegion-"] { min-width: 200%; }
[class^="content-"] [class^="sidebar"] { width: calc(50% - 8px - 72px); }
[class^="chat-"] { width: 100%; }
[class^="tools"] { position: unset !important; }
@ -44,8 +43,16 @@
[class^="member-"],
#channels li,
div[class^="tabBarItem-"] {
margin-top: 16px;
padding: 0 8px;
margin-top: 8px;
padding: 0 12px;
font-size: 11pt;
}
[class^="base-"],
[class^="contentRegion-"],
div[class^="sidebarRegion-"], // all in settings
{
width: 200%;
min-width: 200%;
}
}

View file

@ -3,10 +3,12 @@
* Zlib License
*/
div[class^="userInfo-"] {
// settings
padding-top: 48px;
justify-content: left;
padding-top: 24px;
height: 56px;
button {
margin-left: 32px;
@ -14,7 +16,9 @@ div[class^="userInfo-"] {
}
div[class^="avatar-"] {
top: 32px;
top: 0;
border-radius: 0 !important;
border-bottom-right-radius: 50% !important;
}
}

83
src/settings.less Normal file
View file

@ -0,0 +1,83 @@
/** DisKort
* (c) Er2 2022 <er2@dismail.de>
* Zlib License
*/
// New sidebar in settings
div[class^="standardSidebarView-"] {
flex-direction: column;
div[class^="sidebarRegion-"] {
overflow: auto hidden;
scrollbar-width: thin;
background: var(--background-secondary); // bugfix
flex-basis: unset; // bugfix to normalize height
div[class^="header-"],
div[class^="separator-"]
{ display: none; }
& > div {
overflow: auto hidden !important;
justify-content: left;
max-width: 100%;
& > nav {
padding: 0;
& > div {
flex-direction: row;
height: @tab-height;
}
}
}
}
div[class^="contentRegion-"] {
overflow-y: auto;
scrollbar-width: thin;
* {
max-width: 100%;
}
}
}
div[aria-controls*="nitro"],
div[aria-controls="library-inventory-tab"],
div[aria-controls="subscriptions-tab"],
div[aria-controls="billing-tab"],
div[aria-controls="keybinds-tab"],
div[aria-controls="game-activity-tab"],
div[aria-controls^="hypesquad"],
{
display: none;
}
#connections-tab div[class^="children-"] {
flex-direction: row;
div[class^="accountList-"] {
margin-right: @div-width;
height: 100%; // decreases height? 0_0
}
div[class^="connectionList-"] {
width: 100%;
}
}
#notifications-tab div[class^="children"] {
div:nth-child(6)
{ display: none; }
}
div[class^="accountProfileCard-"] {
div[class^="field-"]:nth-child(1) {
height: 0;
div[class^="constrainedRow-"] {
display: none;
}
button {
top: -48pt;
left: 60vh;
}
}
}

View file

@ -7,6 +7,9 @@
@rounder: 16px;
@roundest: 24px; // text area
@div-width: (@rounder / 2);
@tab-height: 40px;
// Round
// UI elements
div[class^="tabBarItem-"],
@ -69,7 +72,7 @@
// Movement
div[class^="sidebar-"] {
margin-right: (@rounder / 2);
margin-right: @div-width;
}
div[class^="radioBar-"] {
@ -96,12 +99,12 @@ div[class^="radioBar-"] {
border-top-right-radius: @r !important;
}
div[class^="tabBarItem-"],
div[class^="auditLog"] div[class^="headerExpanded-"]
{ .bottom-border(); }
div[class^="auditLog-"] div[class^="changeDetails-"]
{ .top-border(); }
div[class^="auditLog"] {
div[class^="headerExpanded-"]
{ .bottom-border(); }
div[class^="changeDetails-"]
{ .top-border(); }
}
[class*="embed-"],
div[class^="messagesWrapper-"]
@ -121,10 +124,17 @@ section div[class^="children-"]
{ justify-content: center; }
// tabs
div[class^="side-"] div[role="tab"],
div[class^="tabBarItem-"] {
.bottom-border();
margin: 0;
margin-top: 8px;
margin-right: 16px;
padding: 4px 8px;
margin-top: 16px;
}
div[class^="tabBar-"] {
height: @tab-height;
}
[role="tab"][class*="selected-"],
@ -180,3 +190,5 @@ div[class^="channelTextArea-"] {
}
}
}
@import "settings";