Google doesn’t allow users to copy any JavaScript code from anywhere and run it on a webpage by directly pasting it to address bar. They did this because it was causing security issue.

Using Address Bar:

  1. Past that JavaScript code in address bar
  2. Now press Home key from your keyboard or go to starting point of that code in address bar
  3. Type JavaScript: (first type “javascript”, then colon “:”, without any space), now it will get converted into a link
  4. And then press Enter, now that code will be applied (start functioning) on that page

Using Bookmarklet:

You can also create a bookmarklet, to create

  1. Press Ctrl+D (from your keyboard)
  2. Then a popup will open near address bar, click on Edit button
  3. Now past the code at the place of URL (make sure it is starting with JavaScript: else it will not work) and give whatever name you would like to give
  4. After that click on Save button, now whenever you will click on that bookmark and it will get applied on that page (on the page which was opened when you clicked on it)

Using JavaScript Console:

  1. Just press Ctrl+Shift+J, now JavaScript Console will open
  2. Past your JavaScript code their
  3. Then press Enter and it start functioning

 

Firefox

1. Open Web Developer Tools (or use the shortcut Ctrl+Shift+I) and select the Scratchpad (Shift+F4)

2. Once it opens, paste the JavaScript command and click on ‘Run’ at the top to run the script.

LEAVE A REPLY

Please enter your comment!
Please enter your name here