Skip to content

Commit

Permalink
Remove deArrow related code
Browse files Browse the repository at this point in the history
  • Loading branch information
hanydd committed Feb 5, 2024
1 parent aa1114a commit 325ad4b
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 217 deletions.
12 changes: 0 additions & 12 deletions config.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,5 @@
"poi_highlight": "https://wiki.sponsor.ajay.app/w/Highlight",
"guidelines": "https://wiki.sponsor.ajay.app/w/Guidelines",
"mute": "https://wiki.sponsor.ajay.app/w/Mute_Segment"
},
"extensionImportList": {
"chromium": [
"enamippconapkdmgfgjchkhakpfinmaj"
],
"firefox": [
"[email protected]",
"[email protected]"
],
"safari": [
"app.ajay.dearrow.extension"
]
}
}
14 changes: 0 additions & 14 deletions public/help/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,6 @@
>.
</p>

<a
href="https://dearrow.ajay.app"
target="_blank"
id="dearrow-link"
class="dearrow-link hidden"
rel="noreferrer"
>
<img src="/icons/dearrow.svg" />

<span id="dearrow-link-text"> </span>

<img src="/icons/close.png" class="close-button" />
</a>

<p style="margin-bottom: 0; margin-top: 0" class="bigText center">
__MSG_helpPageReviewOptions__
</p>
Expand Down
25 changes: 0 additions & 25 deletions public/help/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -324,31 +324,6 @@ svg {
color: grey;
}

.dearrow-link {
display: flex;
align-items: center;
justify-content: center;
text-decoration: none;

font-size: 16px;
}

.dearrow-link img {
width: 35px;
padding: 10px
}

.dearrow-link .close-button {
opacity: 0;
width: 15px;
filter: invert(0.3);
transition: opacity 0.2s;
}

.dearrow-link:hover .close-button {
opacity: 1;
}

.hidden {
display: none;
}
24 changes: 0 additions & 24 deletions public/options/options.css
Original file line number Diff line number Diff line change
Expand Up @@ -724,27 +724,3 @@ only screen and (max-width: 1200px) {
.promotion-container {
width: fit-content;
}

.dearrow-link {
display: flex;
align-items: center;
justify-content: center;
text-decoration: none;
}

.dearrow-link > img {
width: 40px;
margin-right: 4px;
}

.dearrow-link .close-button {
opacity: 0;
width: 15px;
filter: invert(0.3);
transition: opacity 0.2s;
margin-left: 10px;
}

.dearrow-link:hover .close-button {
opacity: 1;
}
33 changes: 1 addition & 32 deletions public/options/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,24 +61,7 @@

<div id="behavior" class="option-group hidden">

<div id="category-type" data-type="react-CategoryChooserComponent">

</div>

<div id="deArrowPromotion" class="promotion-container hidden">
<a class="dearrow-link"
href="https://dearrow.ajay.app"
target="_blank"
rel="noreferrer">
<img src="/icons/dearrow.svg"/>

<span class="promotion-description">
__MSG_DeArrowPromotionMessage__
</span>

<img src="/icons/close.png" class="close-button"/>
</a>
</div>
<div id="category-type" data-type="react-CategoryChooserComponent"></div>

<div data-type="toggle" data-sync="muteSegments">
<div class="switch-container">
Expand Down Expand Up @@ -182,20 +165,6 @@
<div class="small-description">__MSG_whatShowCategoryWithoutPermission__</div>
</div>

<div id="ytNeuterPromotion" class="promotion-container">
<a class="dearrow-link"
href="https://github.com/mchangrh/yt-neuter/blob/main/docs/filters/sponsorblock.md#install"
target="_blank"
rel="noreferrer">

<span class="promotion-description">
__MSG_YtNeuterMessage__
</span>
</a>

<div class="small-description">__MSG_requiresUblock__</div>
</div>

</div>

<div id="interface" class="option-group hidden">
Expand Down
17 changes: 1 addition & 16 deletions src/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { generateUserID } from "../maze-utils/src/setup";
window.SB = Config;

import Utils from "./utils";
import { getExtensionIdsToImportFrom } from "./utils/crossExtension";
import { isFirefoxOrSafari } from "../maze-utils/src";
import { injectUpdatedScripts } from "../maze-utils/src/cleanup";
import { logWarn } from "./utils/logger";
Expand Down Expand Up @@ -88,20 +87,6 @@ chrome.runtime.onMessage.addListener(function (request, sender, callback) {
}
});

chrome.runtime.onMessageExternal.addListener((request, sender, callback) => {
if (getExtensionIdsToImportFrom().includes(sender.id)) {
if (request.message === "requestConfig") {
callback({
userID: Config.config.userID,
allowExpirements: Config.config.allowExpirements,
showDonationLink: Config.config.showDonationLink,
showUpsells: Config.config.showUpsells,
darkMode: Config.config.darkMode,
})
}
}
});

chrome.runtime.onConnect.addListener((port) => {
if (port.name === "popup") {
chrome.tabs.query({
Expand Down Expand Up @@ -160,7 +145,7 @@ async function registerFirefoxContentScript(options: Registration) {
ids: [options.id]
}).catch(() => []);

if (existingRegistrations.length > 0
if (existingRegistrations.length > 0
&& existingRegistrations[0].matches.every((match) => options.matches.includes(match))) {
// No need to register another script, already registered
return;
Expand Down
29 changes: 1 addition & 28 deletions src/help.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,13 @@ import Config from "./config";
import { showDonationLink } from "./utils/configUtils";

import { waitFor } from "../maze-utils/src";
import { isDeArrowInstalled } from "./utils/crossExtension";

if (document.readyState === "complete") {
init();
} else {
document.addEventListener("DOMContentLoaded", init);
}

// DeArrow promotion
waitFor(() => Config.isReady()).then(() => {
if (Config.config.showNewFeaturePopups && Config.config.showUpsells) {
isDeArrowInstalled().then((installed) => {
if (!installed) {
const deArrowPromotion = document.getElementById("dearrow-link");
deArrowPromotion.classList.remove("hidden");

deArrowPromotion.addEventListener("click", () => Config.config.showDeArrowPromotion = false);

const text = deArrowPromotion.querySelector("#dearrow-link-text");
text.textContent = `${chrome.i18n.getMessage("DeArrowPromotionMessage2").split("?")[0]}? ${chrome.i18n.getMessage("DeArrowPromotionMessage3")}`;

const closeButton = deArrowPromotion.querySelector(".close-button");
closeButton.addEventListener("click", (e) => {
e.preventDefault();

deArrowPromotion.classList.add("hidden");
Config.config.showDeArrowPromotion = false;
Config.config.showDeArrowInSettings = false;
});
}
});
}
});

async function init() {
localizeHtmlPage();

Expand All @@ -49,4 +22,4 @@ async function init() {
if (!showDonationLink()) {
document.getElementById("sbDonate").style.display = "none";
}
}
}
22 changes: 0 additions & 22 deletions src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { localizeHtmlPage } from "../maze-utils/src/setup";
import { StorageChangesObject } from "../maze-utils/src/config";
import { getHash } from "../maze-utils/src/hash";
import { isFirefoxOrSafari } from "../maze-utils/src";
import { isDeArrowInstalled } from "./utils/crossExtension";
import { asyncRequestToServer } from "./utils/requests";
const utils = new Utils();
let embed = false;
Expand Down Expand Up @@ -78,27 +77,6 @@ async function init() {
donate.classList.add("hidden");
}

// DeArrow promotion
if (Config.config.showNewFeaturePopups && Config.config.showUpsells && Config.config.showDeArrowInSettings) {
isDeArrowInstalled().then((installed) => {
if (!installed) {
const deArrowPromotion = document.getElementById("deArrowPromotion");
deArrowPromotion.classList.remove("hidden");

deArrowPromotion.addEventListener("click", () => Config.config.showDeArrowPromotion = false);

const closeButton = deArrowPromotion.querySelector(".close-button");
closeButton.addEventListener("click", (e) => {
e.preventDefault();

deArrowPromotion.classList.add("hidden");
Config.config.showDeArrowPromotion = false;
Config.config.showDeArrowInSettings = false;
});
}
});
}

const skipToHighlightKeybind = document.querySelector(`[data-sync="skipToHighlightKeybind"] .optionLabel`) as HTMLElement;
skipToHighlightKeybind.innerText = `${chrome.i18n.getMessage("skip_to_category").replace("{0}", chrome.i18n.getMessage("category_poi_highlight")).replace("?", "")}:`;

Expand Down
44 changes: 0 additions & 44 deletions src/utils/crossExtension.ts

This file was deleted.

0 comments on commit 325ad4b

Please sign in to comment.