We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
JSON.parse(sourceText)
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.
.innerHTML
One solid indicator of HTML is <!doctype or <html at the start of the file.
<!doctype
<html
You can detect whether a string matches Script by doing new Function("", sourceText) and catching the SyntaxError. But it throws for modules.
new Function("", sourceText)
SyntaxError
The text was updated successfully, but these errors were encountered:
No branches or pull requests
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 theSyntaxError
. But it throws for modules.The text was updated successfully, but these errors were encountered: