Apr 2015
Turn on developers mode in your website

Recently I’ve been working on two websites (IrArc.com and NextOffice.ir) which have a common point; They rely heavily on Javascript! In both cases, they use Ajax technology to fill an HTML element with retrieved data. To debug them I had to refresh the whole page which wastes about 2s of my life every time!

To save this time, I’ve developed a simple “Developer” class which allows me to control the application flow without actually surfing the whole website. For example, I could press “R” on my keyboard and an Ajax request would be sent to the server without interacting directly with the website itself.

The problem was that these simple hacks could be accidentally triggered by users. To solve it I defined two modes for these applications; Developers and non-developers mode (default one). These states were simply activated/deactivated by running following code into the browsers command line:

Developer.toggle();

And Everything worked fine! Yet to save even more time, I developed this bookmarklet wraps that one line command and you can run it by pressing this bookmark button. Just drag and drop Toggle Developers Mode on your bookmarks bar and press it every time you want to visit your websites as a developer! Toggle Developer Mode

Happy “Saving 2 Seconds of Your Life”!