-
Notifications
You must be signed in to change notification settings - Fork 44
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
Always in debug mode? #10
Comments
Yes, it could be possible, as soon as you keep the devtools panel open while reloading. |
Check now with the latest master: the debug mode is automatically activated whenever you reload the page. |
Great. It works. Will work with it later today, but at the moment after several tests, it works. Thanks. |
Good, if you have some other enhancements to suggest (or bugs!), just open a new issue, I will be happy to face it. |
Hi there. There seems to be very same issue with Codekit2 as well. |
This is the code that handles the reloading: https://github.com/Maluen/Backbone-Debugger/blob/master/js/panel/routers/Router.js#L13 this.listenTo(inspectedPageClient, "updated", _.bind(function(updateDetails) {
if (inspectedPageClient.isInjecting) {
// we are injecting scripts into the inspected page
// => reload the panel to wait for injected scripts loading (i.e. backbone agent)
window.location.href = "";
} else {
// if the inspected page still has the backbone agent, then the update isn't a
// "real one" (e.g. is an hash change / push state, etc.) and we can ignore it.
// Note: as a side effect, if the agent isn't in the inspected page because we are
// in a waiting or debug disabled view, than the update is always considered as real
backboneAgentClient.isActive(_.bind(function(isActive) {
if (!isActive) { // the update is "real"
if (updateDetails.urlChanged || !this.debugMode) {
// the user moved to another page/app/site or refreshed the page
// while not in debug mode
// => reload the panel to show the view for activating debugging
window.location.href = "";
} else {
// the update is a refresh while in debug mode
// => reinject the backbone agent to keep the debug mode running
this.restartAppInDebugMode();
}
}
}, this));
}
}, this)); If it is reloading, then the following probably is passing ( if (updateDetails.urlChanged || !this.debugMode) {
// the user moved to another page/app/site or refreshed the page
// while not in debug mode
// => reload the panel to show the view for activating debugging
window.location.href = "";
} Debugging the debugger itself is not the best experience, but you might try to add some debugger statements and check what's going on when the page gets reloaded. Just make sure to first undock the devtools and then press "ctrl+shift+i" (Windows) or "cmd+option+i" (Mac) to open another devtools instance that will inspect the first one! |
Thanks, will take a look later. Sent from my iPhone
|
Before I begin, from what I get from your post is that whenever the URL changes I have to relaunch application in debug mode. Right? |
Exactly! The url changed and the reload is "true", i.e. the debugging code is gone from the page, so it assumes the app is not there anymore. This is limiting in situations like yours or when you just jump to different urls that are still running the same application. I'm thinking of making it always reinject, this way it will stay open wherever you go once you started it, as long as you reload the page by keeping the devtools open. Then a "stop debug" button can be added in the options dropdown to stop it immediately. |
Does having auto inject result into (noticable) performance impact? For now I switched to LiveReload cause I need this badly :-o |
No performance impact, it will just reinject even if you go from your app to random sites, but I think that's something we can pay. Going to push this |
Definitely! Sent from my iPhone
|
…prevent remembering (chrome bug?) #10
Pushed, let me know if you face any bugs, still require more testing. |
Works just fine! Awesome. Thank you a lot! |
Thanks for the feedback! |
I forgot to commit the stop debug mode dropdown button, my bad! Now is here ;) |
👍 Installed from source. |
The project is currently not following semantic versioning, at least for now, a new update will be released when the current codebase is considered to have good stability and with a self-contained set of new features and/or improvements that justifies it. However, the new update is close, but that really depends on how much it takes to complete the pending changes (lazy loading, style adjustments..) |
@Andreyco Version 0.3 is out to the chrome webstore: https://chrome.google.com/webstore/detail/backbone-debugger/bhljhndlimiafopmmhjlgfpnnchjjbhd The intention is to ship new versions in the future as soon as new features / relevant bugfixes have been developed, etc. but prerequisite of this is to have a good testing environment that is missing right now. |
Thank you a lot. |
@Andreyco I mean that we need a robust way to quickly spot regressions and for checking that everything works before releasing. |
Some automated test, I get it. I have only brief experience with Jasmine testing framework. |
Is all still WIP, but we have an open issue for that: #30 |
Is there possibility to have debug mode all the time? I'm using "Live reload" and it's awkward when "Live reload" reloads the page and you need to reload it again yourself to get the debug mode.
The text was updated successfully, but these errors were encountered: