added functionality for pixiv and deviantart

This commit is contained in:
Bryan Van Deusen
2026-02-02 20:17:13 -05:00
parent 3ee7de7ecd
commit cc19bbd372
16 changed files with 158 additions and 27 deletions
+8 -3
View File
@@ -1,12 +1,15 @@
{
"manifest_version": 2,
"name": "GallerySubscriber",
"version": "1.0.0",
"version": "1.1.0",
"description": "Export cookies from supported platforms to GallerySubscriber for automated downloads",
"browser_specific_settings": {
"gecko": {
"id": "gallerysubscriber@fabledsword.com"
"id": "gallerysubscriber@fabledsword.com",
"data_collection_permissions": {
"required": ["none"]
}
}
},
@@ -20,7 +23,9 @@
"*://*.subscribestar.com/*",
"*://*.subscribestar.adult/*",
"*://*.hentai-foundry.com/*",
"*://*.discord.com/*"
"*://*.discord.com/*",
"*://*.pixiv.net/*",
"*://*.deviantart.com/*"
],
"browser_action": {
+48 -17
View File
@@ -11,7 +11,13 @@ document.addEventListener('DOMContentLoaded', async () => {
document.getElementById('setup-required').classList.remove('hidden');
const alertDiv = document.querySelector('#setup-required .alert');
if (alertDiv) {
alertDiv.innerHTML = `<strong>Error</strong><p>${error.message}</p>`;
alertDiv.textContent = '';
const strong = document.createElement('strong');
strong.textContent = 'Error';
const p = document.createElement('p');
p.textContent = error.message;
alertDiv.appendChild(strong);
alertDiv.appendChild(p);
alertDiv.className = 'alert alert-error';
}
}
@@ -51,7 +57,11 @@ async function init() {
// Show loading state for platforms
const platformsContainer = document.getElementById('platforms-list');
platformsContainer.innerHTML = '<div style="text-align: center; padding: 20px; color: var(--text-secondary);">Loading platforms...</div>';
platformsContainer.textContent = '';
const loadingDiv = document.createElement('div');
loadingDiv.style.cssText = 'text-align: center; padding: 20px; color: var(--text-secondary);';
loadingDiv.textContent = 'Loading platforms...';
platformsContainer.appendChild(loadingDiv);
// Now do background tasks in parallel (non-blocking)
// Check if we should test connection (rate limited)
@@ -134,7 +144,7 @@ function updateConnectionIndicator(connected) {
async function loadPlatformStatus() {
const status = await browser.runtime.sendMessage({ type: 'GET_PLATFORM_STATUS' });
const container = document.getElementById('platforms-list');
container.innerHTML = '';
container.textContent = '';
for (const [key, platform] of Object.entries(PLATFORMS)) {
const platformStatus = status[key] || {};
@@ -167,20 +177,41 @@ function createPlatformCard(key, platform, status) {
const statusText = getStatusText(status, platform, key);
const statusClass = getStatusClass(status, platform, key);
card.innerHTML = `
<div class="platform-icon" style="background-color: ${platform.color}">
${platform.name.charAt(0)}
</div>
<div class="info">
<div class="name">${platform.name}</div>
<div class="status ${statusClass}">${statusText}</div>
</div>
<span class="action-icon">
<svg width="20" height="20" viewBox="0 0 24 24">
<path fill="currentColor" d="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z"/>
</svg>
</span>
`;
// Build card content using DOM methods (avoids innerHTML security warnings)
const iconDiv = document.createElement('div');
iconDiv.className = 'platform-icon';
iconDiv.style.backgroundColor = platform.color;
iconDiv.textContent = platform.name.charAt(0);
const infoDiv = document.createElement('div');
infoDiv.className = 'info';
const nameDiv = document.createElement('div');
nameDiv.className = 'name';
nameDiv.textContent = platform.name;
const statusDiv = document.createElement('div');
statusDiv.className = `status ${statusClass}`;
statusDiv.textContent = statusText;
infoDiv.appendChild(nameDiv);
infoDiv.appendChild(statusDiv);
const actionSpan = document.createElement('span');
actionSpan.className = 'action-icon';
const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
svg.setAttribute('width', '20');
svg.setAttribute('height', '20');
svg.setAttribute('viewBox', '0 0 24 24');
const path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
path.setAttribute('fill', 'currentColor');
path.setAttribute('d', 'M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z');
svg.appendChild(path);
actionSpan.appendChild(svg);
card.appendChild(iconDiv);
card.appendChild(infoDiv);
card.appendChild(actionSpan);
if (!isDisabled && !isDiscordWithoutToken) {
card.addEventListener('click', () => exportPlatformCookies(key, card));
+10
View File
@@ -0,0 +1,10 @@
module.exports = {
ignoreFiles: [
"create-icons.py",
"generate-icons.py",
"web-ext-artifacts",
"web-ext-config.js",
".amo-upload-uuid",
"*.md"
]
};