mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 03:34:40 +00:00
fix webpack config
This commit is contained in:
Vendored
BIN
Binary file not shown.
+345
-344
File diff suppressed because one or more lines are too long
+19
-19
@@ -1,3 +1,5 @@
|
||||
/*global chrome*/
|
||||
|
||||
function ReloadSEQTAPages() {
|
||||
chrome.tabs.query({}, function (tabs) {
|
||||
for (let tab of tabs) {
|
||||
@@ -8,7 +10,7 @@ function ReloadSEQTAPages() {
|
||||
});
|
||||
}
|
||||
|
||||
chrome.runtime.onMessage.addListener(function (request, sender) {
|
||||
chrome.runtime.onMessage.addListener(function (request) {
|
||||
if (request.type == "reloadTabs") {
|
||||
ReloadSEQTAPages();
|
||||
} else if (request.type == "githubTab") {
|
||||
@@ -29,7 +31,7 @@ chrome.runtime.onMessage.addListener(function (request, sender) {
|
||||
{ permissions: ["declarativeContent"], origins: ["*://*/*"] },
|
||||
function (granted) {
|
||||
if (granted) {
|
||||
rules = [
|
||||
let rules = [
|
||||
{
|
||||
conditions: [
|
||||
new chrome.declarativeContent.PageStateMatcher({
|
||||
@@ -70,7 +72,18 @@ chrome.runtime.onMessage.addListener(function (request, sender) {
|
||||
}
|
||||
});
|
||||
|
||||
var NewsJSON = {};
|
||||
function GetNews(url, sendResponse) {
|
||||
fetch(url)
|
||||
.then((result) => result.json())
|
||||
.then((response) => {
|
||||
if (response.code == "rateLimited") {
|
||||
url += "%00";
|
||||
GetNews();
|
||||
} else {
|
||||
sendResponse({ news: response });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {
|
||||
if (request.type === "sendNews") {
|
||||
@@ -92,20 +105,7 @@ chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {
|
||||
// var url = `https://newsapi.org/v2/everything?sources=abc-news&from=${TodayFormatted}&sortBy=popularity&apiKey=17c0da766ba347c89d094449504e3080`;
|
||||
var url = `https://newsapi.org/v2/everything?domains=abc.net.au&from=${from}&apiKey=17c0da766ba347c89d094449504e3080`;
|
||||
|
||||
function GetNews() {
|
||||
fetch(url)
|
||||
.then((result) => result.json())
|
||||
.then((response) => {
|
||||
if (response.code == "rateLimited") {
|
||||
url += "%00";
|
||||
GetNews();
|
||||
} else {
|
||||
sendResponse({ news: response });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
GetNews();
|
||||
GetNews(url, sendResponse);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -196,9 +196,9 @@ function UpdateCurrentValues(details) {
|
||||
NewValue[i] = Object.assign({}, DefaultValues[i], CurrentValues[i]);
|
||||
} else {
|
||||
// If the object is an array, turn it back after
|
||||
length = DefaultValues[i].length;
|
||||
let length = DefaultValues[i].length;
|
||||
NewValue[i] = Object.assign({}, DefaultValues[i], CurrentValues[i]);
|
||||
NewArray = [];
|
||||
let NewArray = [];
|
||||
for (let j = 0; j < length; j++) {
|
||||
NewArray.push(NewValue[i][j]);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<svg style="width:24px;height:24px;border-radius:0;" viewBox="0 0 24 24">
|
||||
<path fill="currentColor" d="M6 20H13V22H6C4.89 22 4 21.11 4 20V4C4 2.9 4.89 2 6 2H18C19.11 2 20 2.9 20 4V12.54L18.5 11.72L18 12V4H13V12L10.5 9.75L8 12V4H6V20M24 17L18.5 14L13 17L18.5 20L24 17M15 19.09V21.09L18.5 23L22 21.09V19.09L18.5 21L15 19.09Z"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 340 B |
@@ -0,0 +1,3 @@
|
||||
<svg style="width:24px;height:24px;border-radius:0;" viewBox="0 0 24 24">
|
||||
<path fill="currentColor" d="M19 1L14 6V17L19 12.5V1M21 5V18.5C19.9 18.15 18.7 18 17.5 18C15.8 18 13.35 18.65 12 19.5V6C10.55 4.9 8.45 4.5 6.5 4.5C4.55 4.5 2.45 4.9 1 6V20.65C1 20.9 1.25 21.15 1.5 21.15C1.6 21.15 1.65 21.1 1.75 21.1C3.1 20.45 5.05 20 6.5 20C8.45 20 10.55 20.4 12 21.5C13.35 20.65 15.8 20 17.5 20C19.15 20 20.85 20.3 22.25 21.05C22.35 21.1 22.4 21.1 22.5 21.1C22.75 21.1 23 20.85 23 20.6V6C22.4 5.55 21.75 5.25 21 5M10 18.41C8.75 18.09 7.5 18 6.5 18C5.44 18 4.18 18.19 3 18.5V7.13C3.91 6.73 5.14 6.5 6.5 6.5C7.86 6.5 9.09 6.73 10 7.13V18.41Z"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 649 B |
@@ -0,0 +1,12 @@
|
||||
import DOMPurify from "dompurify";
|
||||
|
||||
export function stringToHTML(str, styles = false) {
|
||||
var parser = new DOMParser();
|
||||
str = DOMPurify.sanitize(str, { ADD_ATTR: ["onclick"] });
|
||||
var doc = parser.parseFromString(str, "text/html");
|
||||
if (styles) {
|
||||
doc.body.style.cssText =
|
||||
"height: auto; overflow: scroll; margin: 0px; background: var(--background-primary);";
|
||||
}
|
||||
return doc.body;
|
||||
}
|
||||
Reference in New Issue
Block a user