Wednesday, June 8, 2016

[Chromium] First Run Customizations

처음 크로미움을 실행할때 Customized된 행동을 정의하여 실행되게 할수있다. master_preferences (윈도우의 경우) 파일을 chrome.exe 와 같은 폴더에 넣으면된다.

master_preferences 파일은 JSON 포멧으로 각 설정을 name / value 형식으로 갖는다. 각 항목은 소스코드를 통해 직접 알수 있다.

{
  "homepage" : "http://dev.chromium.org",
  "homepage_is_newtabpage" : false,
  "distribution": {
     "create_all_shortcuts": true,
     "import_history": false,
     "import_bookmarks": false,
     "import_home_page": false,
     "import_search_engine": false,
     "do_not_launch_chrome": false
  },
  "first_run_tabs": [
     "http://example.com",
     "http://welcome_page",
     "http://new_tab_page"
   ]
}


실제 디버깅을 해보면 first run 인가를 먼저 체크하기때문에 first run으로 만들어줘야하는데
2가지 방법이 있다.

첫번째, --user-data-dir 을 빈 디렉토리로 설정하여 실행한다.
예> ./Chromium --user-data-dir=/Users/limsungguk/foo

두번째, --force-first-run
에) ./Chromium --force-first-run



--- Debugging for https://codereview.chromium.org/2035413002/

// problem: donno the profile.
ProcessMasterPreferences
  DoDelayedInstallExtensionsIfNeeded
    DoDelayedInstallExtensions()
      FirstRunDelayedTask
        EXTENSIONS_READY_DEPRECATED
          DoExtensionWork
            check update.
            delete this

https://codereview.chromium.org/9339003
llㅣㅣ
First_run 하는 방법?
~/AppData/Local/Google/Chrome\ SxS/Application/chrome.exe --force-first-run --user-data-dir=C:/src/deleteme

./out/Debug/Chromium.app/Contents/MacOS/Chromium --user-data-dir=/Users/limsungguk/program_store/trash

No comments:

Post a Comment