We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c83ae11 commit 4dc4468Copy full SHA for 4dc4468
web/packages/extension/src/background.ts
@@ -1,4 +1,5 @@
1
import * as utils from "./utils";
2
+import { isSwfFilename, isSwfMimeType } from "ruffle-core";
3
4
function isSwf(
5
details:
@@ -23,12 +24,10 @@ function isSwf(
23
24
25
// Some sites (e.g. swfchan.net) might (wrongly?) send octet-stream, so check file extension too.
26
if (mime.endsWith("octet-stream")) {
- const url = new URL(details.url);
27
- const extension = url.pathname.substring(url.pathname.lastIndexOf("."));
28
- return extension.toLowerCase() === ".swf";
+ return isSwfFilename(details.url);
+ } else {
29
+ return isSwfMimeType(mime);
30
}
-
31
- return mime === "application/x-shockwave-flash";
32
33
34
function onHeadersReceived(
0 commit comments