Fixing bug on brackets


This regression is from my previous bug fixed

The toggle can remember UI setting, but it doesn’t actually disable javaScript.

We can play the bug by doing this steps:

  • Open up Bramble in a browser
  • Add somewhere in the tag of the index.html file and watch it pop up an alert every time you hit Enter in your editor
  • Open your dev console and type in bramble.disableJavaScript(). Now, every time you press Enter in your editor, you won’t get the alert.
  • Refresh the page and the alert pops up again and every time you hit Enter in the editor, it will alert.
  • Inspect localstorage for the bramble-property::allowJavaScript and you’ll see that it is false. But the editor clearly does not honor that.

Analyze this issue

When we click on the toggle, it sets the UI, and it disables/enables javaScript.

However, when we load it, it only sets the UI without disables/disables javaScript.

We can call the disableScrpt() or enableScript() function when the brackets is loading.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s