mirror of
https://github.com/Anarios/return-youtube-dislike.git
synced 2026-09-12 10:22:10 +02:00
40fda6dd32
* auth works * Works after review. * switched to auth flow * all works well in chrome * all works well in chrome and firefox * translations harmonized * translations harmonized * website translations * Translations harmonized. * Everything kinda works * Almost works * all works * all works * all works #2 * Streamline premium analytics range handling * Restore premium analytics selection flow * Fix analytics zoom interactions * Add per-section expansion controls to premium analytics * Adjust map legend visibility for premium analytics * Add missing country synonyms for premium map * Remove legacy premium badge overlay * Polish premium analytics controls for light theme * Refresh map legend when toggling sections * Improve light-mode styling for range selectors * Fix map mode switching regression * Fix for panel expand * Typo fix * webpack fix * before next steps. * split, zero-buckets * bucket size indicated on UI * all works * first/last toggle * breadcrumbs * release
54 lines
1.6 KiB
JavaScript
54 lines
1.6 KiB
JavaScript
const DEV_API_URL = "https://returnyoutubedislikeapi.com";
|
|
const PROD_API_URL = "https://returnyoutubedislikeapi.com";
|
|
|
|
const runtime = typeof chrome !== "undefined" ? chrome.runtime : null;
|
|
const manifest = typeof runtime?.getManifest === "function" ? runtime.getManifest() : null;
|
|
const isDevelopment = !manifest || !("update_url" in manifest);
|
|
|
|
const extensionChangelogUrl =
|
|
runtime && typeof runtime.getURL === "function"
|
|
? runtime.getURL("changelog/4/changelog_4.0.html")
|
|
: "https://returnyoutubedislike.com/changelog/4/changelog_4.0.html";
|
|
|
|
const config = {
|
|
apiUrl: isDevelopment ? DEV_API_URL : PROD_API_URL,
|
|
|
|
voteDisabledIconName: "icon_hold128.png",
|
|
defaultIconName: "icon128.png",
|
|
|
|
links: {
|
|
website: "https://returnyoutubedislike.com",
|
|
github: "https://github.com/Anarios/return-youtube-dislike",
|
|
discord: "https://discord.gg/mYnESY4Md5",
|
|
donate: "https://returnyoutubedislike.com/donate",
|
|
faq: "https://returnyoutubedislike.com/faq",
|
|
help: "https://returnyoutubedislike.com/help",
|
|
changelog: extensionChangelogUrl,
|
|
},
|
|
|
|
defaultExtConfig: {
|
|
disableVoteSubmission: false,
|
|
disableLogging: true,
|
|
coloredThumbs: false,
|
|
coloredBar: false,
|
|
colorTheme: "classic",
|
|
numberDisplayFormat: "compactShort",
|
|
numberDisplayReformatLikes: false,
|
|
hidePremiumTeaser: false,
|
|
},
|
|
};
|
|
|
|
function getApiUrl() {
|
|
return config.apiUrl;
|
|
}
|
|
|
|
function getApiEndpoint(endpoint) {
|
|
return `${config.apiUrl}${endpoint.startsWith("/") ? "" : "/"}${endpoint}`;
|
|
}
|
|
|
|
function getChangelogUrl() {
|
|
return config.links?.changelog ?? extensionChangelogUrl;
|
|
}
|
|
|
|
export { config, getApiUrl, getApiEndpoint, getChangelogUrl };
|