Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BEFORE YOU BEGIN:
- This process will take a few hours, as well as ~50GB of HDD space - make sure you have room!!!
- Also, I HIGHLY recommend doing this on an SSD if at all possible, will save a LOT of time
- For the file editing, I also recommend using notepad++ (installer is included, you're welcome)
- There is a batch file included at the end of this file, as well as in the build folder.
- You MUST have depot_tools installed and the path set before you run the batch
- Side note: not sure yet, but this whole process MAY require Visual Studio to be installed in order to compile....
- Download depot tools
- https://src.chromium.org/svn/trunk/tools/depot_tools.zip
- Extract somewhere, add that path to %PATH%
- (control.exe sysdm.cpl,System,3) to get to the environment variables quickly
- Add/set the following variables:
- [USER]
- GOOGLE_API_KEY: no
- GOOGLE_DEFAULT_CLIENT_ID: no
- GOOGLE_DEFAULT_CLIENT_SECRET: no
- [SYSTEM]
- DEPOT_TOOLS_WIN_TOOLCHAIN: 0
- open command prompt, navigate to the directory where you want the chromium source
- Run this command:
- fetch --nohooks --no-history chromium
- This will download the chromium source. Wait... takes a very very long time
- cd into src
- Run:
- gclient runhooks
- This will install git as well as many needed packages, takes some time to complete (go grab a coffee)
- For reference: the reason you are manually doing these code changes is because chromium source changes constantly, and if I provide you with the files, it will most likely break something
- Go to src\base, open command_line.cc
- Find this method definition:
- #if defined(OS_WIN)
- void CommandLine::ParseFromString(const string16& command_line) {
- We need to modify this function to hardcode our switches
- At the beginning of the method, add this (modify as needed, switches are below)
- string16 hard_codes = L"--bwsi --app=https://secure.stratanetwork.com/StrataJazz/login.aspx --disable-sync --no-default-browser-check --disable-extensions --no-first-run --disable-contextual-search";
- Now find this line in the same method:
- TrimWhitespace(command_line, TRIM_ALL, &command_line_string);
- Modify:
- TrimWhitespace(command_line + hard_codes, TRIM_ALL, &command_line_string);
- Switches: http://peter.sh/experiments/chromium-command-line-switches/
- --bwsi Indicates that the browser is in "browse without sign-in" (Guest session) mode. Should completely disable extensions, sync and bookmarks.
- --app=<url> Runs chrome in application mode (removed all toolbars, etc)
- --disable-extensions
- --disable-sync Disables syncing browser data to a Google Account.
- --force-app-mode Forces application mode. This hides certain system UI elements and forces the app to be installed if it hasn't been already.
- --homepage
- --no-default-browser-check
- --no-first-run
- --disable-contextual-search
- Save command_line.cc
- Next, disable new windows and new tabs
- src\chrome\browser\ui\browser_commands.cc
- for each of the following methods, add return; on the line after the definition:
- example:
- void NewEmptyWindow(Profile* profile, HostDesktopType desktop_type) {
- return;
- void SavePage(Browser* browser) {
- void ToggleDevToolsWindow(Browser* browser, DevToolsToggleAction action) {
- bool CanOpenTaskManager() {
- return false; <- use false on this one
- void ViewSource(Browser* browser, WebContents* contents) {
- void NewEmptyWindow(Profile* profile, HostDesktopType desktop_type) {
- void NewWindow(Browser* browser) {
- void NewIncognitoWindow(Browser* browser) {
- void NewTab(Browser* browser) {
- Save the file
- Now, disable the context menu
- src\chrome\browser\render_context_menu\render_view_context_menu.cc
- Find:
- void RenderViewContextMenu::InitMenu() {
- RenderViewContextMenuBase::InitMenu();
- add return; on the next line:
- void RenderViewContextMenu::InitMenu() {
- RenderViewContextMenuBase::InitMenu();
- return;
- Disable chrome opening a new browser (for things like "open link in new tab / window")
- src\chrome\browser\ui\browser_navigator.cc
- Find the method:
- Browser* GetOrCreateBrowser
- add return browser; as the first line
- Browser* GetOrCreateBrowser(Profile* profile,
- chrome::HostDesktopType host_desktop_type) {
- Browser* browser = chrome::FindTabbedBrowser(profile, false,
- host_desktop_type);
- return browser;
- }
- Now, we need to build the source
- In your command prompt again (make sure you are in the src directory - cd src), run this command:
- ninja -C out\Release chrome
- First build, it will build ~20K files, so again, go do something else (maybe go get lunch, or some cold water because you sipped that coffee while it was still too hot...)
- now build the mini installer:
- ninja -C out\Release mini_installer
- Once complete, you'll find the mini_installer.exe in the Release folder
- ---------------------------------------------------------------------------------------------------------------------
- ---------------------------------------------------------------------------------------------------------------------
- ---------------------------------------------------------------------------------------------------------------------
- ---------------------------------------------------------------------------------------------------------------------
- BATCH FILE (do after installing depot_tools and setting %PATH% variable)
- Note the path variable on the first line and use of notepad++
- SET CHROMIUMBUILDPATH=c:\chrome
- SET GOOGLE_API_KEY no
- SET GOOGLE_DEFAULT_CLIENT_ID no
- SET GOOGLE_DEFAULT_CLIENT_SECRET no
- SET DEPOT_TOOLS_WIN_TOOLCHAIN 0
- mkdir %CHROMIUMBUILDPATH%
- mkdir %CHROMIUMBUILDPATH%\chromium
- cd %CHROMIUMBUILDPATH%\chromium
- fetch --nohooks --no-history chromium
- cd src
- gclient runhooks
- notepad++ \src\base\command_line.cc
- notepad++ \src\chrome\browser\ui\browser_commands.cc
- notepad++ \src\chrome\browser\render_context_menu\render_view_context_menu.cc
- notepad++ \src\chrome\browser\ui\browser_navigator.cc
- pause
- cd out\Release chrome
- ninja chrome
- ninja mini_installer
- mkdir %CHROMIUMBUILDPATH%\ready
- copy mini_installer.exe %CHROMIUMBUILDPATH%\ready\mini_installer.exe
- robocopy obj\chrome\installer\mini_installer.gen\temp_installer_archive\Chrome-bin\ %CHROMIUMBUILDPATH%\ready\ /MIR
- cd %CHROMIUMBUILDPATH%\ready
- chrome.exe
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement