simplesamlphp / SAML-tracer

Browser extension for examining SAML messages
https://addons.mozilla.org/nl/firefox/addon/saml-tracer/
BSD 2-Clause "Simplified" License
141 stars 39 forks source link

Remove Dependency on InstallTrigger. Replacement is OnBeforeSendHeade… #75

Closed kellenmurphy closed 2 years ago

kellenmurphy commented 2 years ago

…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.

tvdijen commented 2 years ago

@khlr Up to you to merge this.. It's just not my expertise

khlr commented 2 years ago

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?

khlr commented 2 years ago

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 👍