コードからFirefoxを再起動する方法
-
14-11-2019 - |
質問
どのようにの Firefoxを再起動する(「セッションの復元」を「復元する」ものと以前と同じウィンドウを使用して、コードから
Bashスクリプトプロセスで "Firefox-bin"のPIDを知っています。
解決
Services.prefs.setBoolPref("browser.sessionstore.resume_session_once", true);
const nsIAppStartup = Components.interfaces.nsIAppStartup;
Components.classes["@mozilla.org/toolkit/app-startup;1"]
.getService(nsIAppStartup)
.quit(nsIAppStartup.eRestart | nsIAppStartup.eAttemptQuit);
Note that this applies to Firefox 4 so the code might be slightly different for earlier versions.
所属していません StackOverflow