Console Snippets with JavaScript

Hey there guys! I'm new to this, and have been learning JavaScript on Udemy. I'm trying to do everything inside of Safari, instead of using Chrome. But I'm stuck on something that I feel is kind of small, but has been nagging at the back of my brain. When I go to the 'Inspector Developer Tools' (command + option + i), then go to 'Sources', and go to 'Console Snippets', I'm trying to figure out how to delete any JavaScript files from the Console Snippets selection. In Chrome, when you navigate to the Chrome equivalent, if I right click on the file, there's an option to remove the file, but on Safari the only option I get is to Run Console Snippet. Does anyone know how to remove or delete a JavaScript file from the Console Snippets section in Safari? I have no extensions installed.

This has been an issue for a while. It's impossible to delete a Console Snippet once you add one, which is kind of crazy – see the (lack of) documentation in the Web Inspector Reference entry. I created a test snippet about three or four years ago, immediately realized I couldn't remove it, and never used the feature again.

I ran into the same problem. When right clicking or hovering over your console snippet there is not obvious way to delete the console snippet you have created.

I was able to delete my console snippet by navigating to:

Develop -> Show Javascript Console -> Sources

Click on the console script you would like to delete and press the backspace (delete) key.

This should remove your console script. If you have a single script and remove it your Console Snippets tab will be hidden until you create another console script.

Console Snippets with JavaScript
 
 
Q