rev087 / ng-inspector

The AngularJS inspector pane for your browser
ng-inspector.org
MIT License
782 stars 93 forks source link

Getter/Setter && Page Actions #149

Open DrewML opened 9 years ago

DrewML commented 9 years ago

This PR has 2 primary updates

  1. It switches the extension to using a getter/setter to capture when angular is loaded, and hook bootstrapping. This is in contrast to our previous method, which listened for scripts being appended to the DOM and for DOMContentLoaded. While the old method created a race-case for how quickly we could patch bootstrapping, this new method ensures that we always wrap the bootstrap method during it's assignment.
  2. The toggle button in Chrome has been switched to use a 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.
DrewML commented 9 years ago

Changing the way we bootstrap actually ended up fixing 1 or 2 bugs I wasn't aware existed. Check it out:

old/new

It looks like this PR somehow addressed issues with

  1. Scope "creators" not showing
  2. Multiple apps not being detected.
DrewML commented 9 years ago

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:

DrewML commented 9 years ago

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.