Overview and Usage
In this project, I made a chrome web extension that could change the current tab
to incognito mode, also it will delete the browser history of this tab.
To use this web extension, load unpacked web extension in the chrome extensions
page. Then, on the tab you want to change to incognito, click the button in the
extension section on the top right corner of the brower.
Development Process
-
I have first look through the chrome developer page of creating new windows and
clearing brower history. Watched some youtube tuturial videos to about creating
web extensions.
-
Then I have looked up for example project on github to see if there is similar
ones that could inspire my thought.
-
Finally, I modified the code to accomplish my goal that switch current tab to
incognito and delete history.
Issue Deep-Dive
-
The biggest problem I have encountered is when opening a new incognito window, chrome will
open a blank page with error message that I don't have the permission. This is probally a
logic error since the syntax is correct according to VS code.
-
In order to solve this issue, I choose to go through the tuturials on chrome developers page,
MDN web docs, and video tuturial on youtube to better understand the logic of the kind of web
extension I am trying to make. Also, the most helpful method is to learn from the existing
projects on github with similar features.
Ideas and Future
-
Add a new feature that could close the current tab so the users don't need to switch to normal
mode and close it by themselves. This requires get current tab method and remove method.
-
Add a new option to execute the extension when right click on current tab. This requires to use
contextMenus method and needs more permission.
Kudos