Skip to content

Commit

Permalink
fix: ignore blob:// and data:// url (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
monkeyWie committed Apr 19, 2024
1 parent beed726 commit 4430079
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion background/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ export async function checkServer(server: Server): Promise<CheckResult> {
const downloadEvent = chrome.downloads.onDeterminingFilename || chrome.downloads.onCreated

downloadEvent.addListener(async function (item) {
const finalUrl = item.finalUrl || item.url
if (finalUrl.startsWith("blob:") || finalUrl.startsWith("data:")) return

const server = await getSelectedServer()
if (!server) return

Expand All @@ -94,7 +97,7 @@ downloadEvent.addListener(async function (item) {
const asset = <Asset>{
filename: path.basename(item.filename.replaceAll("\\", "/")),
filesize: item.fileSize,
finalUrl: item.finalUrl || item.url
finalUrl
}
chrome.windows.getCurrent((currentWindow) => {
const width = 480
Expand Down

0 comments on commit 4430079

Please sign in to comment.