How to download a Firefox add-on without Firefox - firefox

I am in a corporate network and wanted to install some developer tools for Firefox. Unfortunately policies forbid that Firefox can access the internet directly, but there are other browsers available to go there. Now: how can I download an xpi-file directly without Firefox?
The problem when I access the addons-page for Firefox: the Download-Button is replaced with something similar to "only available in Firefox - download Firefox". Unfortunately I don't have other developer tools available yet, so I can not even inspect the site and look whether an actual link is available. But maybe there is some pattern, how the link could be derived? Or another site where the add-ons are listed?

I found two (and a half) ways overcoming that problem for now. One is simply using another device, that has firefox on it and copy the link from there (as also stated in the comment).
Another variant was to look in the source code of the add-on-page. Hidden within some json-data is the actual download-url, e.g.:
"url":"https:\u002F\u002Faddons.mozilla.org\u002Ffirefox\u002Fdownloads\u002Ffile\u002F<plugin- or download-id>\u002F<plugin-file-name>.xpi?src="
After transforming that url back (basically only replacing the \u002F to / (and any other special symbol)), I could download the xpi without problem.
I also found a page where you could copy&paste the add-on-page into it and it started a plugin download. However I do not know anything about that site otherwise (so use at your own risk). It's name was "XPI Downloader". A pity it doesn't just list the actual url to the add-on itself :-/

Related

Capybara + Downloading and using file

I'm using Capybara to navigate through a login on a website and then download a few files (I'm automating a frequent process that I have to do). There's a few things I tried that aren't working and I'm hoping someone might know a solution...
I have the two links I'm executing .click on, but while one file will start downloading (this is using the Chrome Selenium driver), capybara seems to stop functioning after that. Running .click on the other link doesn't do anything... I figured it's because it's not technically on the page anymore (since it followed a download link) but I tried revisiting the page to click the second link and that doesn't work either.
Assuming I can get that working, I'd really like to be able to download to my script location rather than my Downloads folder, but I've tried every profile configuration I've found online and nothing seems to change it.
Because of the first two issues, I decided to try wget... but I would need to continue from the session in capybara to authenticate. Is it possible to pull the session data (just cookies?) from capybara and insert it into a wget or curl command?
Thanks!
For #3 - accessing the cookies is driver dependent - in selenium it's
page.driver.browser.manage.all_cookies
or you can use the https://github.com/nruth/show_me_the_cookies gem which normalizes access across most of Capybaras drivers. With those cookies you can write them out to a file and then use the --load-cookies option of wget (--cookie option in curl)
For #1 you'd need to provide more info about any errors you get, what is current_url, what does "doesn't work" actually mean, etc

Can sites built with Rapidweaver be worked on without Rapidweaver?

A friend has asked me to do some work on his existing site which was built in Rapidweaver. I'm on Windows, so is there another way I can access and edit his site?
The Rapidweaver project file is meant to be edited only in Rapidweaver, really. As far as I know, the only way around would be to use an HTML editor to modify the pages that are already in the server. However, I would not reccomend you to do it unless you are not going back to Rapidweaver anymore. Because changing the files in the server does not update your local Rapidweaver files. So, you could end up editing something in the server, then getting back to Rapidweaver and upload a "new" version that would not be completely up to date (the previous changes in the server version would be overriden by the older rapidweaver project).
For that kind of work, a CMS (Content Management System) is a more flexible way to work. Nowadays, one of the most common is Wordpress. It will require an inicial setup but after it is working it can be updated from anywhere via web browser, or even from an app in your iPhone. But it is not a Rapidweaver based sollution.
There are a couple CMS related plugins or stacks (Dropkick CMS, Armadillo, Easy CMS, Total CMS...) for Rapidweaver that could also be useful in this context. Once again, first you would need to buy a licence and to setup the website using one of those plugins or stacks. Only then you would be able to edit on the go.

Plugin not being interpreted

I had to copy relevant files from an existing joomla application to a fresh joomla installation. After doing that, some plugins and modules that were working properly on the old installation aren't on the new installation. e.g
I have {chronoforms}Contact_Us{/chronoforms} that is meant to display a contact form, instead if justs echos {chronoforms}Contact_Us{/chronoforms}.
I also have {module _Story_Player} that is meant to display a allvideoshare video but instead just echos {module _Story_Player}
When i access the backend to view these plugins, i get a 500 - An error has occurred with xml missing note, eg, for chronoforms, i get The file chronoforms.xml could not be found although I have all the necessary files copied to the right location.
I have looked through jooomla forums and other resource sites but havent found any pointers so far.
The simplest thing to do would be to re-install the software, as it appears you've missed the relevant configuration files for those plugins (you've probably also missed other files media, language etc).
Chronoforms on JED.
All Video Share on JED
Most good extensions have no problem being installed over an existing or partial installation so you shouldn't encounter any problems.
As #Riccardo Zom, mentions re-installing will also make sure the extensions are properly registered with Joomla! for menus, ACL e.t.c.
What about "Extension Manager" > "Discover" - isn't that supposed to be used in such cases?

Selenium + Firefox + HTTPS

Okay. I know that I am asking a hackneyed, overchewed question but I am posting this because my problem is not getting solved despite trying all the solutions provided on various links.
My constraint - I don't want to use a saved firefox profile to save the website's certificate.
Selenium server version - 2.0b3
Solutions tried -
1) http://seleniumhq.org/docs/05_selenium_rc.html#handling-https-and-security-popups
Browser launcher *firefox
Selenium started with trustAllSSLCertificates option.
Did not help. FF again asks to save the certificate.
2) http://blog.mogotest.com/2010/04/13/how-to-accept-self-signed-ssl-certificates-in-selenium/
Browser launcher *firefoxproxy
Selenium started with trustAllSSLCertificates option.
Did not help.
3) Selenium Testing HTTPs Trust All certificates working for FF but not IE
4) Besides that I tried creating my own cert_override.txt and populating the 5 fields as explained in https://developer.mozilla.org/En/Cert_override.txt but getting the value for the 5th field which is the certificate's serial number and the issuer name as a base64 encoded string is not straightforward as explained in http://tinyurl.com/ce4vn99.
5) Using the Remember Certificate Exception addon for Firefox http://sejq.blogspot.in/2009/01/remember-certificate-exception.html is yet another option but I have not been able to do a full silent install of it. When we drop the xpi file in the required directory, the next time Firefox starts, it will prompt saying that should it found the addon and should it go ahead and install. The addon won't just get reflected in the browser. If anyone can atleast help me with a FULL silent install of this, it would be great!
All I want is that this works in Firefox. I am not interested in IE and Google Chrome.
Any help in providing an answer and not just terming this as a duplicate would be greatly appreciated.
I would suggest an alternative to Selenium.
Have you tried Sahi? It's basically a very similar application, in that it allows scripted browser control, but for a lot of cases it seems to work better than Selenium.
From the Sahi FAQ page:
How does it compare to Selenium?
Sahi is easier to learn and use for testers. Sahi’s recorder works on all browsers. Sahi automatically waits for AJAX and page loads. It does not use XPaths, but uses more intuitive APIs like _in and _near. Sahi works well across frames, iframes, popup windows, sites with dynamic ids, https sites, 401 authentication sites etc. It has inbuilt HTML reports, and ability to run multiple scripts in parallel.
In my experience, this is accurate. There are certain types of browser event that Selenium struggles with, that Sahi handles much better.
I know that doesn't solve your problem with Selenium, and I know it's a pain if you've already written your tests in Selenium to re-do them in Sahi so it may not be the solution you're looking for, but if all else fails, it may be worth considering.
ps - you didn't mention anything about your development environment, but there is a PHP-based testing tool called Mink which integrates with both Sahi and Selenium -- ie you can write the a single test script and have it work in either. I don't know of any similar tool in other languages, but it might be of interest if it helps you migrate between the two.
So the solution turned out to be the 5th point mentioned above.
Here are the steps to solve the issue -
1) Download the Remember Certificate Exception xpi file from https://addons.mozilla.org/en-US/firefox/addon/remember-certificate-exception/
2) Unzip it to get a set of files. Keep them in a temporary folder. (temp_folder/extracted_files)
3) Open the install.rdf file and copy the content of em:id node present in the Description node.
4) Rename the temporary folder just created with this copied string.
5) Place this folder under the profile_name/extensions/ directory. Also delete the extensions.cache/.ini/.rdf files from your profile folder. These need to be deleted so as to prevent the user from being prompted that his profile has been changed and that there is a new addon to be installed. Only if the 3 files are deleted, it will be a fully silent install.
This can be automated using a script.
#!/bin/bash
mkdir /tmp/addon
cp -r ~/POC/remember_certificate_exception-1.0.0-fx.xpi /tmp/addon
unzip /tmp/addon/remember_certificate_exception-1.0.0-fx.xpi -d /tmp/addon
rm /tmp/addon/remember_certificate_exception-1.0.0-fx.xpi
folder_name=$(cat /tmp/addon/install.rdf | grep -m 1 "<em:id>" | cut -f2 -d ">" | cut -f1 -d "<")
mv /tmp/addon /tmp/$folder_name
cp -r /tmp/$folder_name ~/.mozilla/firefox/*.default/extensions
rm -f ~/.mozilla/firefox/*.default/extensions.
https://addons.mozilla.org/en-US/firefox/addon/skip-cert-error/
Use this addon. This will bypass the https errors. This is configurable as well
I've put together an example that shows how to use Selenium to test HTTPS endpoints -- without ignoring certificate validation errors. It shows how to setup the selenium clients with trusted root CAs that can be used to validate the server certificates presented by the HTTPS endpoints being tested. See https://github.com/JeNeSuisPasDave/Selenium-and-TLS
The example demonstrates Chrome and Firefox Selenium nodes. Chrome looks in the system trusted certificate store for root CA certs used for validation; Firefox looks in the cert8.db file within the current profile.
I think this approach is important because I think that instructing your test harness to ignore certificate errors is unnecessarily risky; doing so may eventually hide errors that you wish you had trapped before they got deployed to production.
I wrote an short post about this topic, https://develves.net/blogs/asd/2017-02-20-selenium-and-tls/, but you really just need the example repo linked above.

FireFox API install extension

How do I install, update, uninstall FireFox extensions on Windows?
The article (https://developer.mozilla.org/en/Adding_Extensions_using_the_Windows_Registry) seems like a legacy information...
I have installed FireFox 3.6.3.
However, I don't see "HKEY_LOCAL_MACHINE\Software\Mozilla\Firefox\Extensions" in my registry:
[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla]
[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox]
[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox\3.6.3 (en-GB)]
[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox\3.6.3 (en-GB)\Main]
[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox\3.6.3 (en-GB)\Uninstall]
[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox 3.6.3]
[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox 3.6.3\bin]
[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox 3.6.3\extensions]
For example, I want to install my_ext.xpi (ID: my_ext#my_site.com, Path: c:\myapp\ff_addons\my_ext.xpi).
Could you talk me how can I install my extension ?
Which firefox's versions support this method ?
The extension registry key (HKEY_LOCAL_MACHINE\Software\Mozilla\Firefox\Extensions) doesn't exist by default - simply create it and register your extension there as detailed in Mozilla's instructions (which you linked to).
This method has been working fine for me for over a year now.
You also have another option (which also works on non-Windows machines): Installing Extensions
The windows registry method is not a legacy method, and it's the supported way of installing an add-on for all users on a machine (and all Firefox profiles).
I'm curious as to why you felt it was a legacy method.
Are you talking about an extension or a plug-in?
Extensions are generally installed by having Firefox open an .xpi file. And .xpi files are just .zip files with a manifest (.rdf) and your various scripts and libraries. You can install it manually by creating the right directory structure. On my machine extensions live here: C:\Users\[username]\AppData\Roaming\Mozilla\Firefox\Profiles\[random-number].default\extensions. You create a subdirectory there called yourextension#yourcompany.com and then unzip the contents of your XPI inside the subdirectory. The next time the user re-starts firefox, your extension will be installed. There are a few gotcha's though:
Users have to manually restart Firefox.
You don't know which profile to use if there is more than one. The profile is identified by the [random-number] above. Many users have more than one profile.
On Mac and Linux this is a different directory, though the same basic idea applies.
Plugins are things like Flash that run inside a webpage. You can install those by setting a registry key, but I think in general there is a well-known folder where Firefox looks and loads anything that starts with NP (e.g. NPSWF32.dll). Seriously, it looks for NP. And each plugin must export certain NPAPI functions that Firefox uses to negotiate... stuff.

Resources