Closed kellenmurphy closed 2 years ago
@khlr Up to you to merge this.. It's just not my expertise
filter(Boolean)
is a really smart idea. I like it 🙂👍
I'm just wondering if this will work in Firefox. I can't debug it right now. Did you already debug the change @kellenmurphy ?
I think there's a possible null reference when accessing the both FooOptions.EXTRA_HEADERS
because the options objects only exist in chrome but not in Firefox?
Ah well, forgot what I said 😁 Accessing the options results in undefined if they don't exist. And undefined is falsy which means it will be just filtered out 👍
…rsOptions.EXTRA_HEADERS and OnHeadersReceivedOptions.EXTRA_HEADERS predefined constants.
This fixes #74, implementing Chrome-specific checks to predefined constants that return 'extraHeaders' for Chrome only, and are undefined for other browsers, which we can then filter.