-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
For some reason, scrapper gathers a lot of stuff that is not JS.
If JSON.parse(sourceText) succeeds then we definitely don't care about it.
HTML is harder to pin down; it's wrong to search for tags, because many JS files contain globs of HTML, for use with .innerHTML.
One solid indicator of HTML is <!doctype or <html at the start of the file.
You can detect whether a string matches Script by doing new Function("", sourceText) and catching the SyntaxError. But it throws for modules.
Metadata
Metadata
Assignees
Labels
No labels