How does the Chrome browser implement multi-opening operations? (Mac system as an example)

All tricks that are not aimed at solving problems are hooligans.

unresolved issues

During the test, sometimes it is necessary to verify the login of multiple accounts. In most cases, multiple browsers need to be opened on one computer, but what if you want to use the Chrome browser?

Most of the partners open a private window, but many functions of the private window are unavailable, such as the Chrome plug-in. If I still want to switch the browser proxy through the SwitchyOmega plug-in, the private window cannot meet the requirements.

At this time, you can try to "open more" Chrome browsers, that is, open one more Chrome application, but the user data files use a new directory, so that browser-related configurations, cookies and other data are isolated, so as to achieve a The effect of opening multiple Chrome browsers on the computer (not opening multiple tabs, the data such as cookies of the tabs are shared)

solution to the problem

First create a new directory to store the data of "multiple open" Chrome.

Then enter the directory, and pwdobtain the corresponding path for backup through the command.

Then find the installed Chrome in the application, right-click [Copy], and rename the copied copy. My name is "Google Chrome V1".

On the copied Chrome V1, right-click [Show Package Contents]

Find the Contents/MacOS directory, right-click on the directory, and select [New Terminal Window at Folder Location]

To open the terminal port, first pwdobtain the current path through the command for backup.

Enter the MacOS directory, because the original executable file Google Chromeis a binary file and cannot be modified, so first rename it Google Chrome.real, and then create a new file named Google Chromeas the new entry file.

Then write the following code in the new entry file Google Chrome, replacing the path with the path copied in the above step. Mainly by --user-data-dirspecifying a new data directory, so as to achieve the effect of "multiple opening".

#!/bin/bash
cd "/Applications/Google Chrome V1.app/Contents/MacOS"
"/Applications/Google Chrome V1.app/Contents/MacOS/Google Chrome.real"  --user-data-dir="/Users/huyanping/Softwares/Chrome_V1"

chmod 775 "Google Chrome"Finally, change the new entry file to an executable file by command Google Chrome.

Search again to see the new browser entry

Open the Chrome browser through the new browser entry, you can see that it is a brand new page without any user login data, so you can play happily~

Guess you like

Origin blog.csdn.net/ahu965/article/details/127142047