mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 03:34:40 +00:00
add initial bugfixes
This commit is contained in:
+29
-23
@@ -44,10 +44,7 @@ document.addEventListener(
|
||||
IsSEQTAPage = true;
|
||||
console.log('[BetterSEQTA+] Verified SEQTA Page');
|
||||
|
||||
let link = document.createElement('link');
|
||||
link.href = chrome.runtime.getURL('css/documentload.css');
|
||||
link.type = 'text/css';
|
||||
link.rel = 'stylesheet';
|
||||
const link = GetCSSElement('css/documentload.css');
|
||||
document.getElementsByTagName('html')[0].appendChild(link);
|
||||
|
||||
enableCurrentTheme();
|
||||
@@ -366,19 +363,34 @@ async function RunColourCheck(element) {
|
||||
}
|
||||
}
|
||||
|
||||
export function GetiFrameCSSElement() {
|
||||
var cssFile = chrome.runtime.getURL('css/iframe.css');
|
||||
var fileref = document.createElement('link');
|
||||
fileref.setAttribute('rel', 'stylesheet');
|
||||
fileref.setAttribute('type', 'text/css');
|
||||
fileref.setAttribute('href', cssFile);
|
||||
export function GetCSSElement (file) {
|
||||
const cssFile = chrome.runtime.getURL(file)
|
||||
const fileref = document.createElement('link')
|
||||
fileref.setAttribute('rel', 'stylesheet')
|
||||
fileref.setAttribute('type', 'text/css')
|
||||
fileref.setAttribute('href', cssFile)
|
||||
|
||||
return fileref;
|
||||
return fileref
|
||||
}
|
||||
|
||||
function removeThemeTagsFromNotices () {
|
||||
// Grabs an array of the notice iFrames
|
||||
const userHTMLArray = document.getElementsByClassName('userHTML')
|
||||
// Iterates through the array, applying the iFrame css
|
||||
for (const item of userHTMLArray) {
|
||||
// Grabs the HTML of the body tag
|
||||
const body = item.contentWindow.document.querySelectorAll('body')[0]
|
||||
if (body) {
|
||||
// Replaces the theme tag with nothing
|
||||
const bodyText = body.innerHTML
|
||||
body.innerhtml = bodyText.replace(/\[\[[\w]+[:][\w]+[\]\]]+/g, '').replace(/ +/, ' ')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function CheckiFrameItems() {
|
||||
// Injecting CSS File to the webpage to overwrite iFrame default CSS
|
||||
let fileref = GetiFrameCSSElement();
|
||||
let fileref = GetCSSElement('css/iframe.css');
|
||||
|
||||
const observer = new MutationObserver(function (mutations_list) {
|
||||
mutations_list.forEach(function (mutation) {
|
||||
@@ -626,6 +638,7 @@ export function tryLoad() {
|
||||
'load',
|
||||
function () {
|
||||
CheckiFrameItems();
|
||||
removeThemeTagsFromNotices();
|
||||
},
|
||||
true,
|
||||
);
|
||||
@@ -727,13 +740,9 @@ function main(storedSetting) {
|
||||
}
|
||||
|
||||
function InjectStyles() {
|
||||
var cssFile = chrome.runtime.getURL('css/injected.css');
|
||||
var fileref = document.createElement('link');
|
||||
fileref.setAttribute('rel', 'stylesheet');
|
||||
fileref.setAttribute('type', 'text/css');
|
||||
fileref.setAttribute('href', cssFile);
|
||||
document.head.appendChild(fileref);
|
||||
document.getElementsByTagName('html')[0].appendChild(fileref);
|
||||
const inject = GetCSSElement('css/injected.css');
|
||||
document.head.appendChild(inject);
|
||||
document.getElementsByTagName('html')[0].appendChild(inject);
|
||||
}
|
||||
|
||||
function InjectCustomIcons() {
|
||||
@@ -820,10 +829,7 @@ export function closeSettings() {
|
||||
}
|
||||
|
||||
function addExtensionSettings() {
|
||||
const link = document.createElement('link');
|
||||
link.href = chrome.runtime.getURL('interface/popup.css');
|
||||
link.type = 'text/css';
|
||||
link.rel = 'stylesheet';
|
||||
const link = GetCSSElement('interface/popup.css');
|
||||
document.querySelector('html').appendChild(link);
|
||||
|
||||
const extensionPopup = document.createElement('div');
|
||||
|
||||
@@ -65,4 +65,35 @@ table th {
|
||||
.preamble {
|
||||
border-top-left-radius: 1rem;
|
||||
border-top-right-radius: 1rem;
|
||||
}
|
||||
|
||||
html, p, div, span {
|
||||
color: white !important;
|
||||
background-color: #232323;
|
||||
}
|
||||
body {
|
||||
background-color: #232323;
|
||||
}
|
||||
blockquote.forward > .preamble {
|
||||
color: rgba(255, 255, 255, 0.7) !important;
|
||||
}
|
||||
|
||||
blockquote.forward > .preamble > .date > .value,
|
||||
blockquote.forward > .preamble > .sender > .value {
|
||||
color: rgba(255, 255, 255, 0.7) !important;
|
||||
}
|
||||
blockquote.forward > .preamble > .date > .label,
|
||||
blockquote.forward > .preamble > .sender > .label {
|
||||
color: rgba(255, 255, 255, 0.7) !important;
|
||||
}
|
||||
|
||||
#backgroundTable > * {
|
||||
background-color: #161616;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.userHTML>div>a:not(.resource) {
|
||||
color: #06b4fc;
|
||||
text-decoration: underline;
|
||||
transition: text-shadow 0.5s;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/* global chrome */
|
||||
import { GetThresholdOfColor, GetiFrameCSSElement } from '../../../SEQTA.js';
|
||||
import { GetThresholdOfColor, GetCSSElement } from '../../../SEQTA.js';
|
||||
import { lightenAndPaleColor } from './lightenAndPaleColor.js';
|
||||
import ColorLuminance from './ColorLuminance.js';
|
||||
|
||||
@@ -66,7 +66,7 @@ export function updateAllColors(storedSetting, newColor = null) {
|
||||
}
|
||||
|
||||
let alliframes = document.getElementsByTagName('iframe');
|
||||
let fileref = GetiFrameCSSElement();
|
||||
let fileref = GetCSSElement('css/iframe.css');
|
||||
|
||||
for (let i = 0; i < alliframes.length; i++) {
|
||||
const element = alliframes[i];
|
||||
@@ -79,7 +79,7 @@ export function updateAllColors(storedSetting, newColor = null) {
|
||||
console.log(element.contentDocument.documentElement);
|
||||
|
||||
element.contentDocument.documentElement.childNodes[1].style.color =
|
||||
DarkMode ? 'black' : 'white';
|
||||
DarkMode ? 'white' : 'black';
|
||||
element.contentDocument.documentElement.firstChild.appendChild(
|
||||
fileref,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user