Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 24 additions & 11 deletions Extensions/xkit_patches.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//* TITLE XKit Patches **//
//* VERSION 7.4.23 **//
//* VERSION 7.4.24 **//
//* DESCRIPTION Patches framework **//
//* DEVELOPER new-xkit **//

Expand All @@ -18,7 +18,8 @@ XKit.extensions.xkit_patches = new Object({
});
}

if (XKit.browser().firefox === true && XKit.storage.get("xkit_patches", "w_edition_warned") !== "true") {
const w_edition_storage_key = "w_edition_warned_1";
if (XKit.browser().firefox === true && XKit.storage.get("xkit_patches", w_edition_storage_key) !== "true") {
let version = XKit.tools.parse_version(XKit.version);
if (version.major === 7 && version.minor >= 8) {
fetch(browser.extension.getURL("manifest.json")) // eslint-disable-line no-undef
Expand All @@ -27,12 +28,24 @@ XKit.extensions.xkit_patches = new Object({
if (responseData.applications.gecko.id === "@new-xkit-w") {
XKit.window.show(
"W Edition warning",
"XKit Patches has determined that you are using <br><b>New XKit (W Edition)</b>, an unofficial upload of New XKit.<br><br>" +
'Due to how XKit\'s extension gallery works, this upload violates <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/AMO/Policy/Reviews#Development_Practices" target="_blank">Mozilla\'s policy on remote code execution</a> ' +
"for listed add-ons, and is in danger of being banned at any time; potentially deleting your local XKit data.<br><br>" +
"We recommend installing the official distribution of New XKit from GitHub to avoid this possibility.<br><br>" +
"Be sure to upload or export your configuration using XCloud before uninstalling W Edition. " +
"Also, since the two versions conflict, you should uninstall W Edition before re-installing from GitHub.",
version.minor >= 10
? (
"XKit Patches has determined that you are using <br><b>New XKit (W Edition)</b>, an unofficial upload of New XKit.<br><br>" +
"Extension updates may be delayed or the extension update functionality may be broken, and you may lose access to your local " +
"XKit data if the upload is ever removed.<br><br>" +
"We recommend installing the official distribution of New XKit from GitHub to continue to receive bug fixes and improvements.<br><br>" +
"Be sure to upload or export your configuration using XCloud before uninstalling W Edition. " +
"Also, since the two versions conflict, you should uninstall W Edition before re-installing from GitHub."
) : (
"XKit Patches has determined that you are using <br><b>New XKit (W Edition)</b>, an unofficial upload of New XKit.<br><br>" +
"Extension updates may be delayed or the extension update functionality may be broken.<br><br>" +
'Additionally, due to how XKit\'s extension gallery works, this upload violates <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/AMO/Policy/Reviews#Development_Practices" target="_blank">Mozilla\'s policy on remote code execution</a> ' +
"for listed add-ons, and is in danger of being banned at any time; potentially deleting your local XKit data.<br><br>" +
"We recommend installing the official distribution of New XKit from GitHub to avoid this possibility and " +
"to continue to receive bug fixes and improvements.<br><br>" +
"Be sure to upload or export your configuration using XCloud before uninstalling W Edition. " +
"Also, since the two versions conflict, you should uninstall W Edition before re-installing from GitHub."
),

"warning",

Expand All @@ -43,15 +56,15 @@ XKit.extensions.xkit_patches = new Object({

$("#dismiss-warning").click(() => {
XKit.window.close();
XKit.storage.set("xkit_patches", "w_edition_warned", "true");
XKit.storage.set("xkit_patches", w_edition_storage_key, "true");
});
} else {
XKit.storage.set("xkit_patches", "w_edition_warned", "true");
XKit.storage.set("xkit_patches", w_edition_storage_key, "true");
}
})
.catch(console.error);
} else {
XKit.storage.set("xkit_patches", "w_edition_warned", "true");
XKit.storage.set("xkit_patches", w_edition_storage_key, "true");
}
}

Expand Down