How to Always Launch Brave in Incognito on a Mac

macos
#1

Hello Brave community. I’m using Brave in my mobile phone for a while and it’s great, what it does for blocking to ads is revolutionary. And I decided to use it on Mac as well but there is a slight problem. It records history by default. There is no option like it was on Firefox to not record history and clear on exit as an option and also I couldn’t manage to use the script which makes Chrome to launch in incognito mode by default. This is the code I found and use for Chrome on mac for years and it’s good. Can you help me with this script code to apply it for the Brave?

(For Chrome) Open AppleScript Editor and paste the following script in it:

if application “Google Chrome” is running then

tell application “Google Chrome” to make new window with properties {mode:“incognito”}

else

do shell script “open -a /Applications/Google\ Chrome.app --args --incognito”

end if

tell application “Google Chrome” to activate

0 Likes

#2

The following works on Windows 10 desktop:

Right click Brave taskbar icon
Right click Brave option
Click property
Scroll to Target


Add after …\brave.exe" -incognito
click OK

Hope it does work for you.

0 Likes

#3

Welcome to the Community @bravethinker :wave:

This option will be available with 0.63.x release. :slight_smile:

cc @Mattches for assistance here in case he know about this.

0 Likes

#4

@bravethinker, @utts
When you edit the shortcut path, you need two -'s before incognito. Full path should look something like: ~\Brave-Browser\Application\brave.exe"--incognito
:point_up: Note that there are no spaces between the last quotation mark and the appended --incognito

0 Likes

#5

@Mattches
For me on Windows 10 Home x64 on all chromium base browser, it work as below :
Example … \brave.exe"(space)-incognito
\Brave-Browser\Application\brave.exe" -incognito


Do not know on Mac.

0 Likes

#6

Welcome, @bravethinker. So, the command line that works fine in Terminal is:
          open -a Brave\ Browser --args --incognito

The “” in “Brave\ Browser” tells the OS that the space is part of the name. I’m going to edit the quote below with how I think your thing will work. The app name is “Brave Browser”

If that doesn’t work, add .app in the shell script line like this:
do shell script “open -a /Applications/Brave\ Browser.app --args --incognito”

I don’t think it’s needed since the command line instruction I pasted at the beginning works and doesn’t have it.

Best of luck.

Hnk

1 Like

#7

Great news. When will the 0.63.x version will be released?

0 Likes

#8

Thank you but this code didn’t work. It says there is a problem about “then” in my native language.

0 Likes

#9

Thank you but this is for Windows. I have problem with Mac.

0 Likes

#10

Note as edit: I made some edits because I realized that the script Editor had changed every instance of “Brave Browser” to “Brave Browser Dev”. After I fixed that, the Editor puked on the shell script command, so I added .app to it and it works in the Editor, now. Sorry about that. Not much sleep lately. But what appears below should work, now. </end Note as edit>

The double quotes were “smart quotes” apparently inserted by the forum’s editor and Applescript needed single quotes instead of the slash for the shell script command. It took me a while to get the forum editor to not do that, and I’m still not sure exactly what character is initiating the “code” mode since it happened with an indent from Geany (some kind of tab character?), but what I’m pasting below works - just tried it, then copied it from the preview of this post and tried it again, successfully. If it doesn’t, again, then just paste it in the Editor, delete and retype the double and single quotes, and you should be good to go.

if application "Brave Browser" is running then

	tell application "Brave Browser" to make new window with properties {mode:"incognito"}
else

	do shell script "open -a '/Applications/Brave Browser.app' --args --incognito"

end if

tell application "Brave Browser" to activate
0 Likes

#11

Just in case, here’s the script file, BraveCognito, I saved via my Google Drive (yes, Google - I’ll get a more private one, yet):
https://drive.google.com/open?id=1O-VPadvCpKcoZJpNyaGitBtmyPuzA3QZ

Update: ARGH! The OS keeps putting “Brave Browser Dev” in there! If you download the file, be sure to edit it to change it to “Brave Browser” in all three instances. Hnk’s having a bad code day. :confused:

1 Like

#12

@bravethinker, @hnktong

I found two sites that show how to start chrome in incognito by default on Mac.
Not sure about this forum policy about posting links.
I googled:
how to open chrome by default on windows and mac.
how to force google chrome for mac to open in incognito mode.

You may wish to check it out. Good luck.

0 Likes

#13

@utts, thank you. Since the script had worked for @bravethinker for Chrome, I didn’t even bother searching, and it was partly a formatting issue from the community site that caused the initial error. I tried the second search, and the sites that came up mostly describe (for Mac) the script approach above, but this one (https://www.webnots.com/how-to-open-chrome-in-incognito-mode-by-default/) offers modification of Chrome’s .plist file to have it open in incognito by default. I’ll experiment with Brave’s tonight if I have time (and if I can find it :P)

0 Likes

#14

@hnktong, you are welcome. Shame that for Mac it is so complicated for average user like me. W10 it is so easy.
Keep up the good work and thanks for your support.

0 Likes

#15

@utts It’s actually not that much harder than editing the properties of a Windows shortcut or editing the Registry.

@bravethinker, I played with two methods from that site: one using BareBones’ BBEdit (TextWrangler was discontinued, but BBEdit still can do the XML to binary thing for .plists, apparently), and one using the command line. Editing the .plist directly had no effect, but using the command line did force Brave to open in Incognito/Private mode, and it’s easy even for those who don’t know command line/Terminal.

First, copy these instructions into a text document or something, or maybe use another browser to view this page, because you’ll need to Quit Brave. Then, like the page from the link above directs, go into Finder and do Cmd-Space (you could click the Spotlight magnifying glass in the menu bar, too), type Terminal, and hit return. What you should see before you hit return is this (click image to enlarge):

That should bring up the Terminal window. In there, type:

cd Library/Preferences

then

defaults write com.brave.Browser IncognitoModeAvailability -integer 2

You should have an interaction looking something like this (I did “ls -al” just to show I was in the home directory on opening Terminal):
48%20PM

You can quit Terminal and launch Brave and you should see this:

Ya done!

0 Likes

Always opening Brave Browser, for MacOS, in Incognito+Tor
#16

@hnktong, Thanks again mate. I’ll keep it in mind if I ever migrate to Mac.

0 Likes

#17

Blockquote
Hi HnkTong
I did the above on my Mac (Mojave 10.14.4) but it crashes Brave. I therefore uninstalled the app using TrashMe and re-installed Brave (latest version as at today, 14APR19) hoping this would fix the problem but Brave or the Mac seems to have this setting stuck in incognito and therefore keeps crashing.
Please, could you tell me how I reverse this in terminal.
Many thanks,

0 Likes

#18

Wow, weird. Well, doing the same sequence but using -integer 0 will set it back to the way it was (a zero, not the letter O).

0 Likes

#19

@hnktong many thanks indeed, all good now. Unfortunately, my knowledge in this area is extremely limited (and take full responsibility for any problems that may occur thereafter). I’m happy to give you any info you need if you want to investigate further (as long as I’m not giving out personal info of course).
Again, many thanks,

0 Likes

#20

Glad it worked. If I try to duplicate later I may hit you up for that information. Have a good day.

0 Likes