Windows 7 / Firefox Latest Versions / Preferred 64-bit Beta Versions
Whenever a Firefox profile is updated, a dialog box is provided to the user to check for add-on updates. I would like to interact with this dialog programmatically so that it automatically updates.
So far, my research has led me to: https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIWindowMediator To do this, I need to specify the type of window to list. The window type corresponds to the attribute in the XUL definitions. When installing Firefox, they seem to be compressed inside "c: \ Program Files \ Mozilla Firefox \ browser \ omni.ja \ chrome \ browser \ content \ browser".
I have limited experience with the Firefox API. I am executing the code through userchrome.js.
Any signpost would be happy to receive.
UPDATE 1 20151125 0748 . I believe this is xul - https://archive.is/NyGBS - any pointer to how to "overlay" it in userchrome.js? I can also try to list windows windowtype = "Addons: Compatibility".
UPDATE 2 20151125 0748 . It seems that the extension update dialog is not displayed if I have: user_pref ("xpinstall.signatures.required", false); Which means the addon as unsafe, but allows you to continue using it.
[Which solves my immediate problem, but I’m sure that I will have this requirement at another moment for another dialogue, so anyway I would like to figure it out]
TL DR version with information about the problem.
I currently have a vbs script which:
- Deletes the FIREFOX_RUNNING_PROFILE folder.
- Copies of the FIREFOX_BASE_PROFILE-> FIREFOX_RUNNING_PROFILE folder.
- Starts FIREFOX_RUNNING_PROFILE.
Whenever a firefox update occurs, the user needs to confirm a series of dialogs regarding checking / updating extensions. The result of this process will not match the profile, because, obviously, taking into account my setting, RUNNING_PROFILE recreated every time.
Note that for the purposes of this discussion, it does not matter if udpate is executed automatically. I have the opportunity to rewrite prefs.js, so I can dynamically change the behavior by simply doing this and restarting the browser from the outside - it is vbs right now, but I am ready to go to something else if I hit some restrictions using a process / window or I want this to be portable (e.g. python). Please note that these are not robbers now, and I would be happy for a fixed solution for Windows only.
I have several of these BASE_PROFILES , so I would like to handle updates programmatically.
I did not find a way to achieve this, which does not imply interaction with the firefox dialogs presented in the graphical interface. And I noticed that dialogs appear after each update.
Options
1) userchrome.js -> I already use this to manage some imacros autorun functions, including capturing the profile name from components. Interfaces Below I will talk about fragments to help the reader understand what is the most complex fragment that I wrote against the Mozilla xpcom components:
var strProfileFilePath=Components.classes["@mozilla.org/file/directory_service;1"].getService(Components.interfaces.nsIProperties).get("ProfD", Components.interfaces.nsIFile).path;
I looked at the documentation and looked pretty impressive. It seems that this will allow me to do almost everything, so the next step here would be to abandon how to list the dialogs and somehow choose the right one based on some properties, and then click the "ok" button. I think pretty much everything I need to do.
2) Autohotkey . I can try and send the keys to the firefox window (not sure about the exact dialog box inside the window). Typically, dialogs have shortcuts that respond to these keys (good theory). In autohotkey, I can also “click on a click”, although for obvious reasons it is less desirable.
3). One way through Autohotkey involves using Firefox MozRepl Firefox backstage. The library was discussed here https://archive.is/73u4f , github seems deprecated https://github.com/arbiter34/FF-Control . I could use mozrepl directly, there is no need for Autohotkey. I would prefer code in python, java or even javascript, powershell, vbs than autohotkey. Ar looks like it gives me the same power as userchrome.js.
4) Selenium , There are some profile manipulation features that I could use, although Selenium was not designed to interact with Firefox's own dialogs, and I do not see an API to automate this. Rather, you can synthesize the profile on the fly by installing on top all the necessary extensions from the well-known superprofile (which will contain a superset of all the extensions that will be used), and also applying any mods to prefs.js also dynamically. This sounds a little ugly for my initial requirements, but experience has told me that ugly is still better than leadership.
5) There is also the ability to write an addon , but, again, I think I should interact with the same interfaces that I can get in userchrome.js (in fact, I think that user chrome. Js is even better since it , apparently, has unlimited access to the main components, which I feel that may be needed for my case). I would prefer not to write an addon, although I could get lost in words, trying to explain why. I appreciate that I have not yet “fully” researched further, but now I am at a point where I need to find out the opinion of the community before I start spending significant time on any of them.
The following is not a strict requirement for resolving the above issue, but I think it would be useful to share this, as there should be several others faced with the same predicament:
Additional points:
a. As a general principle, I have no zero desire to update anything (firefox.exe, add-ons, language packs, plugins, etc.) (Plugins are actually completely disabled). I agree with how the system works, and I do not want to change it to one millimeter. Yes, NOTHING, even security updates. This is due to the specific circumstances of my application, my specific assessment of the specific risks that I take, and my general aversion to risk. YMMV . NEVERTHESSESS I am still forced to update whenever (1) I "make a mistake" (all that is required is for one profile, so that the update settings are incorrect for exe to update all profiles on the machine - doh! One exe); (2) Firefox crashes too much / unusable (happened twice); (3) I need the functionality offered by the update (was not); I would also like to reserve an option for "very important security updates" (I sigh, sometimes I can even bow).
b. The secret art of saving your Firefox profile profile in different versions also includes search engines - it doesn’t matter if I say that I don’t want to update them, whenever the update of firefox.exe is updated, I get a new standard fluff installed in the program folder . I currently have a way to reset this: (1) omitting the firefox program subfolder containing the xml files (in% programfiles% \ Mozilla ...) and (2) deleting search-metadata.json and the searchplugins folder (in profile), and then copy them from the baseline again. Everything feels very greasy. I have yet to try this on the 64-bit version, which I'm working with right now, since this is a minor problem, and I would prefer not to introduce more entropy. Meanwhile, the firefox search engine mechanism could change.