Open DrewML opened 9 years ago
Changing the way we bootstrap actually ended up fixing 1 or 2 bugs I wasn't aware existed. Check it out:
It looks like this PR somehow addressed issues with
Found at least one site that doesn't work with this (yet). Since this is such a big change to how bootstrapping currently works, I'm going to keep testing on a bunch of Angular sites and see if I can find any other issues.
Sites that worked prior to change, but don't work now:
bootstrap
twice with null (instead of an element). This didn't cause failures previously because the bootstrap
calls were made before our script monkey-patched the bootstrap
prop (which was fixed in this PR). I'll open a separate issue for us to fail soft when that happens.window.angular
twice, which causes us to try and set a setter on a setter for bootstrap
. Need to add a check for this use-case, although I'd assume and hope it's rare)Note: This PR appears to break Batarang, when Batarang is set to "Enabled" in it's DevTools tab, and ng-inspector is installed.
I'll need to figure out a solution to that prior to us moving these changes in.
This PR has 2 primary updates
DOMContentLoaded
. While the old method created a race-case for how quickly we could patch bootstrapping, this new method ensures that we always wrap thebootstrap
method during it's assignment.pageAction
. It will now only show the toggle to a user (in the address bar of a tab) when Angular is present on the page.