كيفية إعادة تشغيل Firefox من التعليمات البرمجية؟
-
14-11-2019 - |
سؤال
كيفية بشكل صحيح إعادة تشغيل Firefox (دون أي "استعادة جلسة" الأشياء ومع نفس النوافذ كما كان من قبل) من التعليمات البرمجية؟
أعرف PID من "Firefox-Bin" في عملية نصية باش ولدي البرنامج المساعد المخصص الذي تم تحميله فيه.
المحلول
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