Execute callback on Firefox extension installation - firefox

I want to provide my users with a link to install a Firefox extension using the InstallTrigger.install. This requires a Javascript object with url as parameter and a optional callback which is executed after the browser handles the action.
According to the MDN documentation this callback is only executed when the user has whitelisted my website. That would be not the case in 99% of the time.
Would there be another way to execute a callback? The main focus is to provide the user a sensible error message when the installation fails or is cancelled.

Firefox simply cannot know whether the installation is canceled. Typically, when you try to install from a third-party site Firefox will show you the message: "Firefox prevented this site from asking you to install software on your computer." Now the user could click "Allow", he could dismiss the message, but he doesn't have to do either. He could also click Alt-Left to go to the previous page - the notification will stay and the installation can still be started but your web page (and any callbacks) will be gone. And even if the user simply dismisses the message: the extension installation icon stays in the URL bar and the notification can be brought back at any time.
So whatever your website needs to do: just do it, don't wait for the user to make a decision. If you want to explain the consequences of denying the installation - explain them. If you want to present alternative ways to install the extension - present them. But don't expect that you will be given a second chance if the user doesn't want to install your extension.

Related

Selectors only work when webpage is opened in Internet Explorer

I created a login sequence and my selectors for the input email, password, click login and element exists are valid. But only when I have the Internet Explorer page open on the website I'm working with.
I did that sequence again, and I ran it, initially it worked but when I ran the hole project it broke again, I tried "repair" and "indicate", I tried to eliminate the title but nothing is working.
As far as I can see, you are using selector attribute:
"title=ACME System 1 - Dashboard"
Try using a wildcard: title='ACME System 1*', so it can work when you leave the dashboard.
This worked for me when I took those UiPath Academy courses.
In order to automate tasks within a browser with UiPath, the browser must be open. There is an activity called Open Browser that's included in the default activities for every project. You need to add this activity to the beginning of your sequence and pass in the appropriate parameters, (ie. URL, browser type) you can then pass the outputted browser variable to an attach browser sequence and execute your browser automation acivities within that.
Browser activity sceenshot
In addition, the selector that you have shared does not look like a stable selector. There may be other 'H1' elements on the screen that will cause your automation to fail. I would use the UI explorer to help you build a better, more stable selector.
Did you initially use IE to indicate screen elements and then changed the BrowserType property to use a different browser? Please share the sequence to suggest you a fix for your issue.
I would also suggest you to modify the selector to 'title='ACME System *'.
In order for selector to work the application needs to be open and the desired element needs to be available. So when you close the browser the selector disappears.
You may consider swithching to 'Modern Design Experience' and use 'Use Application/Browser' scope to make this more intuitive, and it will also automatically open the browser for you if it is closed.

Display informational message to user when installation finished for install Shield Suite project

I have created setup.exe using install Shield Suite project. I want to display informational message to user when installation finished i.e when user clicks on finish. How to achieve this?
There are few way to achieve this. For Basic MSI project, probably the simplest way is to add Custom Action (CA) which will display the dialog with information you want to show. This CA may also launch for example "Notepad" to display text or some other application. After call this CA on click of the "Finish" button. To attach your CA to this event use IDE to go to the following path ...
User Interface "Dialogs" -> SetupCompleteSuccess "Behavior" -> OK Push Button "DoAction"
Inside DoAction pick the CA you've created, add conditions if needed. Other than DoAction you may also choose to SpawnDialog which will gives you new modal dialog (Displaying Dialogs During Basic MSI Installations).
The note from myself: I don't believe this is all good idea. As the user I would expect the setup wizard to quit when I press "Finish" button. Users (including myself) don't like any popups or even worth, additional dialogs after finishing installation. On other hand, probably this is your requirements and this is what you want to do.

Check if application is not running

I am developing a WiX installer (I am very new to this) and want to implement a method (like launch condition) which check if a particular application is running or not. If it's running then a warning message will popup displaying close the application message. I want this check before the welcome screen.
How can I implement this? Some working example will really help me a lot.
Windows Installer already has a FilesInUse and RMFilesInUse (Restart Manager) support. Does this not meet your needs? With these patterns you'll get a dialog telling the user that they need to exit a program or risk needing a reboot.
This can be done only through a custom action. Here is a tutorial for a C++ DLL native custom action: http://www.codeproject.com/Articles/1747/MSI-Custom-Action-DLL
Your custom action can perform the check and then show a message to the user if necessary. It
can return 0 to continue the installation or 1602 to stop.
To show the message before Welcome dialog, you can try scheduling your custom action right after CostFinalize action in InstallUISequence.

Details of the Firefox add-on installation procedure

I am curious about the inner workings of the Firefox add-on installation procedure. I have noticed that the following steps take place when user installs an add-on from addons.mozilla.org:
The add-on is downloaded (probably in a temporary folder).
An installation confirmation dialogue box pops up ("install add-ons from authors you trust").
Upon clicking install, the add-on is stored in the /extensions/staged folder. Along with the add-on, there is also a JSON file like this: addon_id.json.
Firefox prompts the user to restart the browser.
After restart, the contents from the /extensions/staged/ folder are moved to the /extensions/ folder.
What I would like to know is:
Which code portion in the Firefox source code is responsible for step 5? I am assuming some c++ or js code or some xpcom module is responsible for figuring out that an add-on is waiting to be installed in the staged/ folder, and performs the necessary steps (moving the files, registering the add-on etc.). Can anyone please point me to that module/code?
Where is the add-on stored temporarily, when it is downloaded (step 1)?
Basically, I would like to alter some files after an add-on is downloaded at step 1, but before it becomes part of the browser (step 5). I want to add this functionality in the Firefox source code.
You analysis is mostly correct, it merely leaves out bootstrapped extensions. Bootstrapped extensions don't require a browser restart, they will be moved out of the staged directory and activated immediately.
The Add-on Manager is all JavaScript starting with Firefox 4. The important files are amWebInstallListener.js (the component handling add-on installations from the web), AddonManager.jsm (the generic add-on management API) and XPIProvider.jsm (the provider for XPI-packaged extensions).
extWebInstallListener.onWebInstallRequested() gets called with a bunch of AddonInstall instances (defined in XPIInstall.jsm) and creates an Installer instance that calls AddonInstall.install() for each of the installs. The downloads go into a temp file determined by getTemporaryFile() in XPIProvider.jsm (tmp-foo.xpi in the OS-specific temp directory).
Installer.checkAllDownloaded() determines that all downloads finished and displays a modal confirmation dialog (URI_XPINSTALL_DIALOG).
AddonInstall.startInstall() moves the add-on into the staging directory. Bootstrapped add-ons will be immediately installed after that. For other add-ons it continues to step 4.
onInstallEnded listeners are triggered - one of them shows the message that the browser needs to be restarted.
After a browser restart XPIProvider.startup() calls XPIProvider.checkForChanges() calls XPIProvider.processPendingFileChanges().

Explicit save vs. implicit save - what to prefer when?

I'm currently developing a wp7 app (don't want to tell too much ;), but I'm struggling a little with the user interaction.
The main question, I'm not sure about is: Should I offer an explicit save button in dialogs and use the phone back button as cancel, or should I save implicit the time the user taps the phone back button ...
The more I think about, the more I'm unsure about the best user experience.
I already read the user experience and interaction guide from Microsoft, but there isn't any advice in there about that issue ...
Thx alot for your suggestions.
On page 68 of the Windows Phone 7 UI Design and Interaction Guide it states:
Changes to Application Settings should be immediately implemented. This means that a "Done", "OK", or other confirming dialog is not neededd. In some cases, even though the change has happened immediately, the user may not have feedback that the change has occurred until an ongoing event is completed or a future event occurs. Examples would be joining a secure Wi-Fi network or changing the frequency of alarms.
Keeping Application Settings brief and clear should be a design goal. Complex, multi-page, multi-level Application Settings can frustrate or confuse users into thinking that they have entered another application entirely.
Although the same page also goes on to say:
Immediately implement user-selected Application Settings without a confirming dialog box and provide a feedback method to indicate that the change has occurred.
Avoid creating Application Settings that have more than 2 pages (screens). Settings that require more than a single screen should use overlying half screens to avoid losing context when
the SIP Keyboard is displayed.
If a task cannot be undone, always provide the user with an option to cancel. Text entry is an example. Actions that overwrite or delete data, or are irreversable must have a “Cancel” button.
When using additional screens with commit and cancel buttons, clicking those buttons should perform the associated action and return the user to the main settings screen.
To keep the heading of settings control panels consistent, the heading for the settings page should look as follows:
SETTINGS
<CPL Name/ Application Name>
Applications that fetch data over the network must have an option to disable data usage.
So, I think you only get in to questions over explicit vs. implicit if you have multiple pages for settings, and if you do it sounds like the explicit would be the way to go with sub-pages, but implicit for the initial page.
You should use explicit saving of settings.
However, for data entered it will depend on the application and the data being entered.
It's typcial to include a save button (or equivalent) otherwise there's (probably) no way for the user to cancel out of a partially entered form. This can also cause issues if there are validation issues which would prevent the saving of the partially entered data.
It depends on the app though. There is no universal rule for this.

Resources