Combining Bookmarklets to create a toggle between HTTP and HTTPS?
问题 By searching here, I now have two bookmarklets, which switch from/to HTTP/HTTPS :- javascript:location=location.href.replace(/http:/g,"https:") And ... javascript:location=location.href.replace(/https:/g,"http:") But is there a way, please, to combine them into a single bookmarklet, which will toggle from one to the other according to whichever is presently loaded? 回答1: This thread is a little old, but I haven't found a better answer anywhere else. javascript:((function(){window.location