Skip to content

Commit

Permalink
fix: Corriger l'analyse d'un onglet sous Chromium.
Browse files Browse the repository at this point in the history
  • Loading branch information
regseb committed Jan 8, 2022
1 parent 2ab5a0b commit d22e0c5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/core/scrapers.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ export const extract = async function (url, options) {
allFrames: true,
file: "/script/extractor.js",
});
const file = files.find((f) => undefined !== f);
// Tester aussi avec null car c'est une valeur retournée par Chromium.
const file = files.find((f) => undefined !== f && null !== f);
if (undefined !== file) {
return file;
}
Expand Down
2 changes: 1 addition & 1 deletion test/unit/core/scrapers.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ describe("core/scrapers.js", function () {
{ headers: { "Content-Type": "text/html;charset=utf-8" } },
));
const stubExecuteScript = sinon.stub(browser.tabs, "executeScript")
.onFirstCall().resolves([undefined])
.onFirstCall().resolves([undefined, null])
.onSecondCall().resolves([undefined, "http://foo.fr/baz.mp4"]);

const url = new URL("http://foo.fr/bar.html");
Expand Down

0 comments on commit d22e0c5

Please sign in to comment.