Skip to content

Remove useless window.setTimeout call - #3

Open
SamB wants to merge 1 commit into
mementoweb:masterfrom
SamB:patch-1
Open

Remove useless window.setTimeout call#3
SamB wants to merge 1 commit into
mementoweb:masterfrom
SamB:patch-1

Conversation

@SamB

@SamB SamB commented Jul 20, 2019

Copy link
Copy Markdown

Well, the code has been passing the value of sendMetaInfoToExtension() to window.setTimeout for the past 5 years. That value is undefined, which evidently gets subjected to an [approximation of eval][1]. There don't seem to be any observable effects of this other than triggering a CSP violation when the page's script-src policy doesn't include unsafe-eval, so just call sendMetaInfoToExtension() and don't set the timeout.

Well, the code has been passing the *value* of
`sendMetaInfoToExtension()` to `window.setTimeout` for the past 5
years. That value is `undefined`, which evidently gets subjected to an
[approximation of `eval`][1]. There don't seem to be any observable
effects of this other than triggering a CSP violation when the page's
`script-src` policy doesn't include `unsafe-eval`, so just call
`sendMetaInfoToExtension()` and don't set the timeout.

[1]: https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers:report-the-exception
@SamB

SamB commented Jul 27, 2019

Copy link
Copy Markdown
Author

Hmm. Perhaps I should have been more explicit about the logspam?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant