Comments (6)
Unfortunately there's no easy way to do this. Chrome (and other browsers) are pretty strict with shielding off incognito. However, you can launch the chrome program in incognito mode and pass the URL you want as an argument. This might be a bit tough to do if you're not that experienced with the commandline and how windows works (I'll assume you're on windows).
The goal is to launch the chrome process with the --incognito flag and the new URL as the argument. This will open that tab in incognito mode. Here's a link to the syntax for the flag: https://stackoverflow.com/questions/11857123/how-to-open-a-url-in-chrome-incognito-mode. In order to do that you need to register a new URL scheme that opens given parameter in incognito mode. You can use the "opening a desktop program" wiki page for setting up a custom scheme, which can be found here: https://github.com/SanderRonde/CustomRightClickMenu/wiki/Opening-a-desktop-program. The only tricky part is getting the syntax of the custom URI scheme correct (i.e. the order of the arguments should be correct). For some help on that check out this page: https://msdn.microsoft.com/en-us/windows/desktop/aa767914. Unfortunately I'm not an expert on the area of custom URI schemes so I can't help you a lot in that regard. It's also for a big part a matter of trying until you get it right.
I hope this can help you somehow and if there's anything else I can help you with please let me know.
from customrightclickmenu.
Hello, may I ask you a followup question?
I created an registry entry for "mychrome" whith the value ""C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "%1" "--incognito""
When I call mychrome:// from the browser, a incognito window is opened but I have no clue, how to pass the value (eg). mychrome://http://www.google.de does not work, neither mychrome://abc .
from customrightclickmenu.
I tried to do this myself as well and found that the reason it doesn't work is the following. %1 passes the full matched scheme to the target application. This means that if you run mychrome://abc chrome gets run with "mychrome://abc". Since this is, again, a URI scheme (it's the very same one you passed in the first place), it will basically keep infinitely opening new chrome windows. I assume someone has added a check for that in the chrome code because that's not what happens.
What you can see though, is that if you invalidate the scheme (for example you don't use "%1" but "'%1'" with added quotes inside), it will open the passed URL but it's invalid. Because of this there's no infinite loop and it opens it.
The result here is that it's not directly possible to open a URL in chrome, as chrome gets the whole scheme as a parameter and doesn't know what to do with it. Something you can do though, is to create/use a different program that slices out the custom scheme and then finally calls chrome with the sliced version. Fortunately, I've gone ahead and created a program that does that over here. All you need for the program is python. Here's a short summary of how it works, since the program itself contains a better explanation that you can see when you pass "-h".
Call the program with the scheme as the first parameter (this is the "%1") in the scheme in the registry. Then pass what you want to be run, replacing the to-be-passed data with a "#" followed by the index of the to-be-passed value in the scheme. Since this sounds a bit complicated, here's an example:
In the registry (where python.exe and sliceuri.py's locations will change)
"python.exe" "sliceuri.py" "%1" "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "--incognito" "#1"
This will be called (when using the URI mychrome://www.google.com) as:
python.exe sliceuri.py "mychrome://www.google.com" "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "--incognito" "#1"
And will be translated to run:
C:\Program Files (x86)\Google\Chrome\Application\chrome.exe "--incognito" "www.google.com"
from customrightclickmenu.
from customrightclickmenu.
Oh yeah that's actually quite a bit limitation. I've revised the script to take this into account. You can now pass "-s" as the first argument to ignore any slashes past the scheme itself. The URL to the script will be the same, you'll just have to re-download it.
from customrightclickmenu.
from customrightclickmenu.
Related Issues (20)
- Disabling handling of userscript installs HOT 1
- Get Selected Elements HOT 4
- Execute when visiting specified sites HOT 1
- [wiki] please give an example how to pass link as an argument for search engine HOT 3
- [wiki]How to add Copy Tab URL HOT 8
- [Questions] Window title! + couple extras HOT 8
- CRX_SIGNATURE_VERIFICATION_FAILED - Cant add extension to edge HOT 3
- [wiki] Download Tutorial HOT 26
- An error occurred. The package is invalid:“CRX_SIGNATURE_VERIFICATION_FAILED” HOT 1
- Can't run the script on chrome-extension:// page. HOT 1
- Is it possible to add items straight to the context menu and not into the submenu? HOT 3
- Cannot rename main node (Custom Menu) to something else in EDGE (works in Google) HOT 3
- Manage permissions dialog is not working HOT 2
- Project abandoned or in development HOT 7
- Bug: Cannot view or edit submenu HOT 1
- Is it possible the use the current tab url in the link settings? HOT 2
- add text to the context menu that when you click on the text it adds it to the form text box HOT 5
- Get text from the CRM item clicked HOT 18
- True copy and paste operation vs determining which field I right clicked in HOT 5
- addon hijacks .js file links HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from customrightclickmenu.