the popup menu has a button to "export" the playlists. it currently puts the playlists and the playbackHistory into a json object along with the exportDate, and triggers the browser to download it. how feasible would it be to add openTabs to the export, containing a url and page title for each? don't make any code changes yet, just propose a plan for now.
The export functionality is in popup.js lines 435-474 in the exportPlaylists() method:
HIGHLY FEASIBLE - The implementation would be straightforward:
"tabs" permission in manifest.jsonbrowser.tabs.query() available to get all open tabsbrowser.tabs.query({}) call to get all open tabsopenTabs array to export data objectexportPlaylists() method// Add after getting history data:
const tabsResult = await browser.tabs.query({});
const openTabs = tabsResult
.filter(tab => tab.url && !tab.url.startsWith('moz-extension://') && !tab.url.startsWith('about:'))
.map(tab => ({
url: tab.url,
title: tab.title
}));
// Add to export data:
const exportData = {
playlists,
playbackHistory,
openTabs,
exportDate: new Date().toISOString(),
};
Proceed with implementation - This is a low-risk, high-value addition that fits naturally with the existing export functionality.
exportPlaylists() method in popup.jsbrowser.tabs.query({}) call to retrieve all open tabsmoz-extension:// URLs (Firefox extension pages)about: URLs (Firefox internal pages)chrome:// URLs (Chrome internal pages)openTabs array to export data structure// Get open tabs
let openTabs = [];
try {
const tabsResult = await browser.tabs.query({});
openTabs = tabsResult
.filter(tab => tab.url &&
!tab.url.startsWith('moz-extension://') &&
!tab.url.startsWith('about:') &&
!tab.url.startsWith('chrome://'))
.map(tab => ({
url: tab.url,
title: tab.title || 'Untitled'
}));
} catch (error) {
console.warn("Could not retrieve open tabs:", error);
openTabs = [];
}
// Create export data object
const exportData = {
playlists,
playbackHistory,
openTabs,
exportDate: new Date().toISOString(),
};
The exported JSON now includes:
{
"playlists": { /* existing playlist data */ },
"playbackHistory": { /* existing history data */ },
"openTabs": [
{
"url": "https://example.com",
"title": "Example Page Title"
}
],
"exportDate": "2025-06-06T..."
}
openTabs arrayopenTabs field