In the past, Google Chrome was expanded by using JavaScript bookmarks, just as in previous articles. Today, I finally saw Google Chrome's extended feature (document), so I wrote one.
Requirement: I subscribed to some Google group content in Google Reader, but I forgot to start from it. I cannot open the content directly from Reader. The reason is that the RSS link provided by Google group uses HTTP, but it seems to be blocked, but it can be opened through HTTPS. However, after each opening, you must manually add "S" after the Protocol! In fact, I have always wanted to write something similar to the previous script, but I haven't written it yet.
Function and operation method: after the extension is installed, if the page opened is HTTP (or cannot be opened through HTTP ), A "green arrow pointing to a lock" icon is displayed at the end of Chrome's address bar. Click this icon, and the protocol section in the URL will be replaced with HTTPS, and the rest will remain unchanged.
: Use https v1.0.crx (not submitted to Google Chrome extension Gallery)
MainCode:( In the background page)
chrome. pageaction. onclicked. addlistener (function (Tab) {chrome. tabs. update (tab. ID, {URL: "https: //" + TAB. URL. substr (7), selected: true}) ;}); chrome. tabs. onupdated. addlistener (function (Tabid, changeinfo, Tab) {If (tab. URL. substr (0, 7 ). tolowercase () = 'HTTP: // ') {chrome. pageaction. show (Tabid);} else {chrome. pageaction. hide (Tabid) ;}});