Tabs does not reopen / Close button actually close all tabs

Hello! I have issue with tabs reopen function while using multiple profiles.

  1. create 2 or more profiles
  2. set brave to “continue where you left off” on startup
  3. open some tabs in both profile windows
  4. close one of profiles/windows (it even ask if you want to close all tabs)
  5. reopen profile
  6. tabs are gone of course.

Is there way to keep tabs open while using more than 1 profile and CMD+Q hotkey/quit from dock? Quit does kill all Brave windows/profiles, that’s not what I want to do.

I need some way to just close specific profile windows while keeping tabs as I am using maybe 20+ profiles.

I am not sure if it’s bug or this option does not exist but it definitely should!

Thanks!

@lucidnx

Please edit your Original Post (“OP”) above, in order to include:

  • Brave Browser version numbers
  • Operating System version numbers

MacOS keyboard keys combination

Command + Q = Quit the application.

Otherwise, closing a Brave Browser user Profile is accomplished by closing all of that Profile’s windows. On the Mac, closing a window is accomplished by

clicking on the RED dot located at the upper left-hand corner of the window

-OR-

if the window is frontmost, using keyboard keys combination:

Command + W

Also on the Mac, the user may close all of the application’s windows . . . yet an application like an Internet browser usually will continue to run.

Pressing key combination (altogether):

Option + Command + ESC ( ← Escape key )

will display a list of running applications. I usually do not click on “Force Quit” - I usually click on the application’s icon in the Dock.


Given the setting that is Enabled: “Continue where you left off”

If key combination: Command + Shift + T ← does not restore the Tabs, then there may be an un-resolved bug:

thanks, but please re-read my message. I have explained why both are useless in my case..

No, there is no way to do this and this will be true for just about any browser as far as I know of because that’s now the way macOS works. @289wk is exactly right in everything he replied with.

On macOS if you quit the application process then, as you said, the application gets closed entirely. But if you have two profiles open and click the x to close one, then you re-open that profile, your tabs will be there just as they were before as long as your profile is set to Continue where you left off in Settings --> Get started:

hmm.. this did not work for me, at least from what I’v tried. I am going to try this again because after closing window with tabs, on next reopen tabs were gone.

Then you’re either clearing data on exit for that profile or you have Brave set to Open to the new tab page on startup instead of Continue where you left off:

@lucidnx

The following are a couple of AppleScripts that are a pair.

Briefly, you can run “Export_Brave_Tabs.scpt” in order to create an HTML file named “Brave_Tabs_Backup.html” on the MacOS Desktop. And, you can run “Restore_Brave_Tabs.scpt” in order to create within an existing, new Brave Browser window, the restored Tabs.

The “Export_Brave_Tabs.scpt” backs up all open Tabs from all open Brave Browser windows. Restoration of all Tabs is to a single, new Brave Browser window.

The restoration AppleScript, is not [yet] sophisticated enough to restore sets of Tabs to more than one Brave Browser new window.

In order to upload these scripts to the Brave Community, they are text files ← the contents of which can be copied and pasted into new AppleScript windows, and then those AppleScripts can be saved.

The AppleScript named “Export_Brave_Tabs.scpt” is thus created from file “Export_Brave_Tabs_UPLOAD.txt”

The AppleScript named “Restore_Brave_Tabs.scpt” is thus created from file “Restore_Brave_Tabs_UPLOAD.txt”

'Export_Brave_Tabs_UPLOAD.txt' for making AppleScript named 'Export_Brave_Tabs.scpt'

--
--
-- Export all open Brave tabs to a simple HTML file on the MacOS Desktop
--
--
-- This following AppleScript is now intended to create a backup of all open Brave Browser window Tabs, from all open Brave Browser windows.
--
-- The AppleScript will produce only one HTML file named "Brave_Tabs_Backup.html".
--
-- Thereafter, that backup can be used as a source for restoring such tabs, to a single new Brave Browser window. The restoration AppleScript, named "Restore Brave Tabs.scpt" is my notion, with some help from website 'https://perplexity.ai"
--
-- The following AppleScript, that I named "Export_Brave_Tabs.scpt", was originally written for Google Chrome users, but I significantly changed and added to the original AppleScript, so it works for Brave Browser (MacOS) and does more than the original script. (See notes that credit the original author(s), at end of this script.)
--
-- You can easily read the exported Tabs file, "Brave_Tabs_Backup.html", by opening it with an Internet browser.
--
-- Please Note: I have only tested by using a Brave Browser window that has 4 Tabs.
--
-- The latest MacOS that I have, is v14.8.3 Sonoma, on a mid-2020 MacBook Pro (Intel). I do not know what may happen with MacOS Tahoe and later versions - especially on Apple "M" machines. Apple cannot resist fiddling with what works, and some AppleScript commands / lines, may not work in the future.
--
--
--
--
set report_Title to "Brave Tabs Backup"
set url_list to {}
--
set date_stamp to (current date) as string
set noteTitle to "<h2>" & report_Title & " | " & date_stamp & "</h2>"
--
tell application "Brave Browser"
activate
set allWindows to windows
repeat with w in allWindows
repeat with t in tabs of w
try
set tabTitle to title of t
set tabURL to URL of t
if tabURL is not missing value and tabURL is not "" then
set tabLine to "<p><a href=\"" & tabURL & "\">" & tabTitle & "</a><br>" & tabURL & "</p>"
set end of url_list to tabLine
end if
end try
end repeat
end repeat
end tell
--
-- join lines into HTML text
set AppleScript's text item delimiters to linefeed
set htmlBody to (noteTitle & linefeed & (url_list as text))
set AppleScript's text item delimiters to ""
--
set fileName to "Brave_Tabs_Backup.html"
--
-- These next 2 lines would not work:
-- set desktopFolder to (path to desktop folder as text)
-- set backupFileAlias to (desktopFolder & fileName) as alias
-- So, my workaround, designed to get AppleScript on MacOS 14.8.3 Sonoma, to pay attention regarding what is, and will be:
--
set POSIX_path_to_DskTop_file to (POSIX path of (path to home folder as string) & "Desktop/" & fileName)
set POSIX_file_string to ((POSIX file POSIX_path_to_DskTop_file) as string)
--
-- write the file
--
set fp to open for access POSIX_file_string with write permission
set eof of fp to 0
write htmlBody to fp as «class utf8»
close access fp
--
(*
Found an AppleScript at: "https://veritrope.com/code/export-all-brave-tabs-to-a-text-file/"
Veritrope.com
Export All Brave Tabs to a Text File
VERSION 1.0
September 8, 2012
// INSPIRED BY: Francesco Di Lorenzo (@frankdilo)
20241031 Thursday
Renamed "Chrome" to "Brave"
I made several **Significant Changes** to the original downloaded AppleScript file.
The original AppleScript was written for Google Chrome users.
Now, this AppleScript is written for Brave Browser (MacOS) users.
*)
--
--
--
--

'Restore_Brave_Tabs_UPLOAD.txt' for making AppleScript named 'Restore_Brave_Tabs.scpt'

--
--
-- Restore Brave tabs from an html list of URLs on the MacOS Desktop
--
-- This AppleScript relies on your already having produced an HTML file named "Brave_Tabs_Backup.html" - located on the MacOS Desktop - by using an AppleScript named "Export_Brave_Tabs.scpt"
--
--
--
--
set desktopFolder to (path to desktop folder as text)
set backupName to "Brave_Tabs_Backup.html"
set backupAlias to (desktopFolder & backupName) as alias
--
-- read file contents
set fp to open for access backupAlias
set fileContents to (read fp as «class utf8»)
close access fp
--
-- split into lines (URLs)
set AppleScript's text item delimiters to linefeed
set urlList to text items of fileContents
set AppleScript's text item delimiters to ""
--
-- work towards a list of only the Tabs' URL addresses
--
set urlListText to quoted form of (urlList as text)
--
set fenceLine to "ZZZZZZZZZZZZZZZZZZZZ"
--
tell me to set clean01 to (do shell script "echo " & urlListText & " | sed -e 's@\\<@ @g' -e 's@\\>@ @g' -e 's@\"@ @g' -e 's@ @" & fenceLine & "@g'")
--
set AppleScript's text item delimiters to fenceLine
set nuList to text items of clean01 as list
set AppleScript's text item delimiters to ""
--
set countItemsA to count of items in nuList
--
set nexList to {}
repeat with i from 1 to countItemsA
set thisItem to item i of nuList as string
try
set firstPart to characters 1 thru 4 of thisItem as string
if (firstPart is "http") then
set the end of nexList to thisItem
end if
end try
end repeat
--
-- remove duplicate Tab URL addresses
--
set countItemsB to count of items in nexList
set truList to {}
repeat with n from 1 to countItemsB
set urlAddrss to item n of nexList
if (urlAddrss is not in truList) then
set the end of truList to urlAddrss
end if
end repeat
--
set urlList to truList
--
-- make a new Brave Browser window that includes all of the Tabs stored
--
tell application "Brave Browser"
activate
-- open a fresh window
make new window
set theWindow to front window
set firstTitle to title of theWindow as string
--
set tabsCount to (count of tabs of theWindow)
repeat with u in urlList
set theURL to contents of u
if theURL is not "" then
-- First URL can be set on the existing first tab
if (tabsCount = 1) then
if (URL of tab 1 of theWindow is "about:blank") or (firstTitle is "New Tab") then
set URL of tab 1 of theWindow to theURL
end if
end if
-- after establishing the 1st Tab . . .
if (tabsCount is greater than 1) then
make new tab at end of tabs of theWindow with properties {URL:theURL}
end if
set tabsCount to (tabsCount + 1)
end if
end repeat
end tell
--
--
--
--

In order to Copy, you Copy everything of, and within, the lightly-shaded-gray . . . example:

--
--
-- Export all open Brave tabs to a simple HTML file on the MacOS Desktop
--

And Paste into a new AppleScript window.

You can read the “Brave_Tabs_Backup.html” file on the MacOS Desktop, by using any Internet browser.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.