-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
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
SAMLTracer.js Error in Firefox Developer Edition (103.0b2) #74
Comments
I think this is where it goes awry: Lines 907 to 913 in a500371
Apparently your browser does not satisfy the test in the method "isFirefox()". So a value is sent that Firefox does not understand. Question is why your Firefox is not Firefox. |
This Bugzilla item seems to describe more about the InstallTrigger deprecation and explicitly mentions the use of this construct to test for Firefoxness. And if understand it well, also that in "late beta" they will make using InstallTrigger for this purpose work again? |
We might consider doing an actual user agent check instead of using this strange |
@thijskh you're spot on. In "about:config" I checked and extensions.InstallTrigger.enabled was set to "false". Setting that to "true" makes SAML-Tracer work once more, though now with a deprecation warning in the console:
My reading also matches yours... by release they'll make InstallTrigger work. Thanks so much @thijskh for taking a second look at this. It does seem that perhaps at some point in the future, there may need to be a refactor to remove the InstallTrigger references and -- I guess? -- implement UA checking or something? I think this issue can probably be closed now, though, don't you? |
This is a really interesting issue! 🙂👍 I think you have to ask yourself why We could easily utilize the user agent string to determine the browser type. By doing something like Instead we could use feature detection and check if the "feature" "extraHeaders" is available. Probably by doing something like this: var browser = browser || chrome;
const useExtraHeaders = () => {
try {
const dummyListener = req => console.log(req);
browser.webRequest.onBeforeSendHeaders.addListener(dummyListener, {urls: ["<all_urls>"]}, ["extraHeaders"]);
browser.webRequest.onBeforeSendHeaders.removeListener(dummyListener);
// seems to be Chrome which supports an requires "extraHeaders"
return true;
} catch (err) {
// seems to be Firefox since "extraHeaders" is not supported
return false;
}
}
console.log(useExtraHeaders()); But I'm afraid this is a pretty expensive piece of code to check for the feature... Any ideas? |
Is it actually still a problem to pass the extra parameter in Firefox? Because it is in the Mozilla MDN and nothing on that page indicates it wouldn't work on Firefox.. Is it perhaps something from the past? If we still need it, it should perhaps be possible to test the amount of parameters onBeforeSendHeaders takes? Like |
The problem isn't |
Ah, my bad.. Forget what I said :) |
Ideally we'd change the detection method. But I would only change it if it's actually a significant improvement. The code suggested by @khlr seems indeed quite a lot of code/effort for the simple case. They are adding the object back in late beta (even if it's only null) precisely because the way we test for it was "the way to do it" and many extensions did it. So I'm not afraid it will break quickly in the future. It would seem a premature optimization to replace this simple check with complex code if the simple check is not likely to go away for the forseeable future. So long story short, I'd like to replace it only if there's a similarly straightforward check available. |
How about the |
I think there may be a predefined constant can be leveraged here (see: https://stackoverflow.com/questions/69287721/how-to-manipulate-webrequest-cookie-in-a-cross-browser-extension). Specifically, the answer:
I'll try to test this... would be happy to create a PR with that change if it works. It seems to me that a simple check that can be applied with initiating the listener seems like the simplest solution long term, and potentially the new "right way" to do things once |
Thank you for this contribution, Kellen! 🙂 However, I think we can do without a release for now, since |
You're very welcome @khlr! I've been using this valuable tool for so long I figured I shouldn't be afraid to dig into it... I totally agree with you re: release... likely anyone knowledgeable to notice this problem (using FF dev or beta) is knowledgable to google it and find the solution anyway, but being prepared for the eventual deprecation of |
SAML-tracer appears to have stopped functioning in the latest Firefox Beta (Developer Edition tracks with Beta)
I've tried tried disabling all other extensions, etc. This occurs only with FF 103 insofar as I can tell... which will be the "main" version of Firefox come July 22. I don't know precisely that this is an issue with SAML-tracer vs. FF, though a cursory search on Bugzilla doesn't reflect anything related to changes/bugs with
webRequest.onBeforeSendHeaders
.Screenshot:
Could any of the maintainers provide some insight? I typically use developer edition just so that I have a completely separate browser for debugging SAML (hate clearing cache on my main browser). I can work around this tentatively, but I'd hate to see FF103 drop in July and break SAML-Tracer.
The text was updated successfully, but these errors were encountered: