You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// In Firefox, the download interception logic will be triggered twice, the order is onHeadersReceived -> onCreated, so a variable is needed to skip the onCreated event to avoid duplicate processing of download tasks.
175
+
// PS: Why not use the onCreated event uniformly? Because the onCreated event cannot get the size of the downloaded file in Firefox.
176
+
letdownloadEventSkip=false
174
177
175
178
downloadEvent.addListener(asyncfunction(item){
176
179
constinfo: DownloadInfo={
@@ -181,6 +184,10 @@ downloadEvent.addListener(async function (item) {
181
184
referrer: item.referrer,
182
185
cookieStoreId: (itemasany).cookieStoreId
183
186
}
187
+
if(isFirefox&&downloadEventSkip){
188
+
downloadEventSkip=false
189
+
return
190
+
}
184
191
185
192
if(!downloadFilter(info,settingsCache)){
186
193
return
@@ -218,14 +225,18 @@ function checkContentDisposition(
0 commit comments