How to detect unsupported browsers?

http://browser-update.org/ isn’t working when I paste it’s script tag into the DOM Header Insertions. Other options like https://github.com/outdatedbrowser/outdated-browser say to place the script tag in the body for maximum compatibility, but I don’t think we have an option for that in BetterForms.

Assuming this is for older codebases …

It may not work because the main code base loads prior to the insertions, they get inserted dynamically after the code initially loads.

As for the other one, I am not sure why they need it to be in the body, either way it will run but It may do some injecting for the UI error message …

If on your older code the base code still first loads ( before any incompatible things are invoked )
Then you may be able to alert the use with some JS

HTH
c

I think I’ve figured it out. Since the DOM Insertions are loaded by other JS, I had to modify the browser-update.org suggested code in a few ways:

  • change var $buoop to window.$buoop
  • just run the code vs adding an event listener… maybe DOMContentLoaded already ran by the time this code is injected?

End result:

<script>
  window.$buoop = {required:{e:-4,f:-3,o:-3,s:-1,c:-3},insecure:true,unsupported:true,api:2020.09};
  var e = document.createElement("script");
  e.src = "//browser-update.org/update.min.js";
  document.body.appendChild(e);
</script>

ok, that only worked when I added test:true to the options defined in $buoop… back to the drawing board, I guess.

I’m not sure what you meant by “older codebase” but I’ve been testing on both bf-latest and bf-staging.

bf-staging at the time of this post, has the IE improved compatibility. If its something in there that is not fully compatible and can be fixed, we are glad to include it in the next build.