HTTP Form Submit Alerts

Alert the user when they submit forms.

  1. // ==UserScript==
  2. // @name HTTP Form Submit Alerts
  3. // @namespace HTTP Form Submit Alerts
  4. // @version 0.1.0
  5. // @description Alert the user when they submit forms.
  6. // @author Martin H. McWatters
  7. // @license MIT
  8. // @match *://*/*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12.  
  13. function formSubmitted() {
  14. if(document.getElementsByTagName("form").onsubmit()) {
  15. siteURL = window.location.href || document.URL;
  16. alert('Wait! You are submitting a form on ' + siteURL + ". Make sure you trust this site!");
  17. if (siteURL[6] == 'http://') {
  18. alert('Are you REALLY sure? This is an insecure site. Your data is significantly more prone to hackers this way.')
  19. }
  20. }
  21. }