-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update manifest.json and scripts.js, and add opmlhelper.js and settin…
…gs.html files
- Loading branch information
1 parent
9a01834
commit 8071152
Showing
6 changed files
with
157 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
// Function to handle file upload | ||
function handleFileUpload(file) { | ||
|
||
console.log("🚀 ~ handleFileUpload ~ file", file); | ||
// Check if the file is an OPML file | ||
if (file) { | ||
const reader = new FileReader(); | ||
reader.onload = (e) => { | ||
const parser = new DOMParser(); | ||
const xmlDoc = parser.parseFromString(e.target.result, "text/xml"); | ||
|
||
let urls = []; | ||
const outlines = xmlDoc.getElementsByTagName("outline"); | ||
for (let i = 0; i < outlines.length; i++) { | ||
const outline = outlines[i]; | ||
if (outline.getAttribute("type") === "rss") { | ||
const xmlUrl = outline.getAttribute("xmlUrl"); | ||
if (xmlUrl) { | ||
urls.push(xmlUrl); | ||
} | ||
} | ||
} | ||
console.log("Imported URLs:", urls); | ||
|
||
updateSubscribedFeeds(urls); }; | ||
reader.readAsText(file); | ||
} | ||
// Return an empty array if the file is not an OPML file | ||
return []; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters