How do I install WebExtension that developed by myself to Firefox Nightly? - firefox

I already know the way to temporarily install an add-on for debugging.
However, I want to install it persistently. I do not want to upload it to AMO, because I've developed it for use by myself only.
How do I install it on Firefox Nightly?
Browser: Firefox Nightly 56a1
OS: macOS 10.12.5
Edit
I attempted Andrew's way while referring to Getting started with firefox-addon, but an error occurred (This add-on could not be installed because it appears to be corrupt.), despite that temporary installation was successful.
Why did installation fail only when installing it from Install Add-on from File...?
Source code is here
https://github.com/KiYugadgeter/webext
Edit2:
The following is Error message on browser console.
1497764354857 addons.xpi WARN Invalid XPI: Error: Cannot find id for
addon /
Users/username/jsworks/webextensions/stacknotifier/something.xpi (resource://gre/modules/addons/XPIInstall.jsm:1642:17) JS Stack trace: loadManifest#XPIInstall.jsm:1642:17 <
async*init#XPIInstall.jsm:2122:13 < async*createLocalInstall#XPIProvider.jsm:4820:12 < getInstallForFile#XPIProvider.jsm:3437:5 < callProviderAsync#AddonManager.jsm:297:12 <
promiseCallProvider/<#AddonManager.jsm:321:53 < Promise#Promise-backend.js:390:5 <
promiseCallProvider#AddonManager.jsm:320:10 < getInstallForFile/<#AddonManager.jsm:1856:29
< async*getInstallForFile#AddonManager.jsm:1854:13 < getInstallForFile#AddonManager.jsm:
3560:7 < doCommand/<#extensions.js:1472:13
[Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIURI.hostPort]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: resource://gre/modules/PopupNotifications.jsm :: PopupNotifications_refreshPanel/< :: line 806" data: no]

Recent versions of Firefox require you to sign the extension before you can permanently install it. To get your extension signed you don't have to publish it. All you need is a tool called web-ext. Then you can simply run this from your terminal:
web-ext sign --api-key=$AMO_JWT_ISSUER --api-secret=$AMO_JWT_SECRET
Getting started with web-ext:
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Getting_started_with_web-ext
web-ext sign:
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/web-ext_command_reference#web-ext_sign
Getting your AMO_JWT_ISSUER and AMO_JWT_SECRET:
https://addons.mozilla.org/en-US/developers/addon/api/key/
In short:
Downlaod and Install NodeJS
Open a new terminal and run npm install --global web-ext
Go to api key site and get your AMO_JWT_ISSUER and AMO_JWT_SECRET
Open a new terminal, go into the folder which contains your extension sources and run
web-ext sign --api-key=xxxx:xxxxxxx:xxx --api-secret=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Your error is: Invalid XPI: Error: Cannot find id for addon
Quoting WebExtension documentation:
When do you need an Add-on ID?
If you are loading the add-on from it's XPI file, are not loading it temporarily using about:debugging and it is not signed.
...
This is your situation; as such, you need to fill out the applications.gecko.id key in the manifest. This plays the similar role as setting key key in Chrome (in Chrome, the ID of a packed extension is a hash of the key field).
Alternatively (and possibly preferably), you can sign your XPI as indicated by Forivin's answer, because loading unsigned WebExtensions is only possible in Nightly. That would require interaction with AMO - but there's no requirement to host there.

Since you said you're using Nightly, you can also go to about:config, find the preference "xpinstall.signatures.required" and flip it to false. Then you should be able to install your extension from about:addons -> "Install Add-on from File..."

Related

OSX fix Selenium Chromedriver launch error spawn Unknown system error -86 Bad CPU type in executable?

Suddenly on the afternoon of January 6, 2021, my Selenium Protractor tests under OSX stopped working with the mysterious error
spawn Unknown system error -86
I did some research and discovered that error number 86 is the same as
Bad CPU type in executable
and ran the following to compare the cpu architecture of my chromedriver binary to my system:
% file chromedriver_87.0.4280.88
chromedriver_87.0.4280.88: Mach-O 64-bit executable arm64
% uname -a
Darwin kobl179273m 19.6.0 Darwin Kernel Version 19.6.0: Thu Oct 29 22:56:45 PDT 2020; root:xnu-6153.141.2.2~1/RELEASE_X86_64 x86_64
% uname -p
i386
How can I fix the chromedriver binary used by my Selenium so that it will run on my Intel x64 mac and clear the "system error -86" or "Bad CPU type" message?
The issue is described in https://github.com/angular/webdriver-manager/issues/476.
This has been now fixed in 12.1.8 so just update to that webdriver manager.
For most users this can be accomplished with
npm uninstall protractor && npm install protractor
Edit: this answer should be considered deprecated now that the underlying bug in webdriver-manager has been fixed. A better solution would be to upgrade to the newest version of webdriver-manager. The answer below may be useful if people need to use an older version of webdriver-manager which still has the bug.
As per Deepak Srinivasan's comment above, this error is caused by https://github.com/angular/webdriver-manager/issues/476
Root Cause:
The ChromeDriver team added "_m1" to the end of the filename for their Apple Silicon ARM builds of Chromedriver -- but both the Silicon and Intel versions of chromedriver have "mac64" in the filename, and the version number is exactly the same. This causes webdriver-manager to always download the Silicon build of Chromedriver, even on Intel macs. As a general solution, simply avoid using the chromedriver that has _m1 in its filename if you are on an Intel mac.
Solution 1: Downgrade to Chrome 86.0.4240.198 and Chromedriver 86.0.4240.22. These versions work together and are the most recent versions prior to the new and problematic support for Silicon ARM
Chrome 86 download page:
https://google-chrome.en.uptodown.com/mac/download/2920124
Disable auto-updates in Chrome: https://superuser.com/questions/1359017/how-do-i-disable-automatic-updates-of-google-chrome-on-mac-os-x
Chromedriver 86: https://chromedriver.storage.googleapis.com/index.html?path=86.0.4240.22/
% webdriver-manager update --versions.chrome=86.0.4240.22
Solution 2: Modify the webdriver-manager npm package to point to the correct chromedriver (thanks to ciekaway from the angular github issue page for this fix)
Modify the following file
node_modules/webdriver-manager/built/lib/files/file_manager.js
or, if using protractor
node_modules/protractor/node_modules/webdriver-manager/built/lib/files/file_manager.js
Near the top of the downloadFile method around line 166, add the following line to remove "_m1" from the name of the file:
fileUrl.url = fileUrl.url.replace(/_m1/, '');
It needs to be after the beginning of the .then block that starts with
binary.getUrl(binary.version()).then(fileUrl => {
it also needs to be before the next reference to fileUrl.
For example:
binary.getUrl(binary.version()).then(fileUrl => {
binary.versionCustom = fileUrl.version;
fileUrl.url = fileUrl.url.replace(/_m1/, '');
let filePath = path.resolve(outputDir, binary.filename());
Note that this solution is temporary. It will be overwritten by an npm install. The Chromedriver and/or the webdriver-manager team will probably fix this issue, at which point you should clear the modified version of your webdriver-manager and download the fix from npm.
For macOS Catalina Version 10.15.6 (19G73)
In my case I was working with Rails and Capybara for feature tests. What worked for me was
First, find the actual chromedriver location running:
which chromedriver
# Which returned:
/Users/alex/.webdrivers/chromedriver
Then, install chromedriver via Homebrew:
brew install chromedriver
Then, remove old chromedriver reference found at previous location with:
rm /Users/alex/.webdrivers/chromedriver
Now, link the old chromedriver reference to the one installed with brew:
ln -s /usr/local/bin/chromedriver /Users/alex/.webdrivers/chromedriver
Then, open Finder app, then click on Go menu and then click Go to folder ... option, and enter this route:
/usr/local/Caskroom/chromedriver/
There you should see a folder with the chromedriver version you have installed, something like this:
88.0.4324.96
Enter that folder and you should see the chromedriver binary file.
Right click on it, and click on Open
Now, you should get a terminal window popping up with the output:
Last login: Sun Jan 31 12:29:15 on ttys001
/usr/local/Caskroom/chromedriver/88.0.4324.96/chromedriver ; exit;
  ~  /usr/local/Caskroom/chromedriver/88.0.4324.96/chromedriver ; exit;
Starting ChromeDriver 88.0.4324.96 (68dba2d8a0b149a1d3afac56fa74648032bcf46b- refs/branch-heads/4324#{#1784}) on port 9515
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
Finally, press Ctrl+C to stop the execution and quit the terminal window.
Now, you should be able to run capybara tests.
npm uninstall protractor && npm install protractor
If you use webdrivers gem, upgrade it:
bundle update webdrivers

Cannot open Firefox in Windows Subsystem For Linux

Firefox version: 77.0.1
X Server: Vc X Server (VcXsrv)
Ubuntu: 18.04 LTS
When I attempt to launch Firefox, I get the following message:
"Firefox has just been updated in the background. Click Restart Firefox to complete the update."
Doing so does not fix it.
What I have tried:
Opening about:config and setting browser.tabs.config.autostart and browser.tabs.config.autostart2 to false
Opening about:support page and click on Refresh Firefox (this starts up firefox again, but the URL bar no longer works as well, so I cannot do about:config or about:support anymore)
Updating and upgrading all packages with apt
Here are the first few errors I see when I attempt to start it up:
[Parent 11057, Gecko_IOThread] WARNING: FileDescriptorSet destroyed with unconsumed descriptors: file /build/firefox-Wud6wF/firefox-77.0.1+build1/ipc/chromium/src/chrome/common/file_descriptor_set_posix.cc, line 19
Exiting due to channel error.
###!!! [Parent][MessageChannel] Error: (msgtype=0x2000A0,name=PBrowser::Msg_SafeAreaInsetsChanged) Channel error: cannot send/recv
###!!! [Parent][MessageChannel] Error: (msgtype=0x200096,name=PBrowser::Msg_LoadRemoteScript) Channel error: cannot send/recv
There are many more after, but follow a similar format to those second two.
Am I just missing a package? Or is FF fundamentally just not compatible with WSL?

flutter doctor hangs after "Updating flutter tool..."

First: I have used Google to search for "flutter doctor" and searched your
site as well. I will detail my results below, but before that here is where I am:
1) I followed the directions at https://flutter.io/setup-windows/ up to the point where I am unable to proceed.
2) My environment is:
Windows 10, 64 bit, 210 Gb free space
Intel(R) Core(TM) i5-2320 CPU # 3.00GHz; 8.00 GB installed memory(RAM)
I have PowerShell 5.1,
I have setup Git for Windows with "Use Git from
the Windows Command Prompt" option
I am able to run git from the command prompt or power shell
3) I tried downloading the .zip of the beta but when I ran the
"flutter doctor" command it just hung.
4) Now for the search results:
I found 3 relevant questions:
a) "Getting Flutter doctor to work" - I tried cloning the "alpha" version
and checked the "Background Intelligent Transfer Service was running" (it
was).
b) "Running Flutter Doctor without any results" - I removed the alpha version
and cloned the beta version using git bash with the following results:
rex#NEXIUM MINGW64 /c/flutter
$ git clone -b beta https://github.com/flutter/flutter.git
Cloning into 'flutter'...
remote: Counting objects: 122267, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 122267 (delta 0), reused 0 (delta 0), pack-reused 122262
Receiving objects: 100% (122267/122267), 37.56 MiB | 2.39 MiB/s, done.
Resolving deltas: 100% (91730/91730), done.
Checking out files: 100% (2473/2473), done.
This also did not work (i.e. flutter doctor still hangs)
c) "Flutter doctor is not running in command prompt" - this one had the most
promising result:
I deleted the cache folder under the ..\AppData\Roaming\Pub directory.
when I ran "flutter doctor" this time I got the following results:
C:\Users\rex>flutter doctor
Checking Dart SDK version...
Downloading Dart SDK from Flutter engine 09d05a38912a3c1a906e95099cac9a7e14fae85f...
Unzipping Dart SDK...
// here there was some text above the ========== in the console about bits...
// which went away, window appeared compressed and then the following message:
Updating flutter tool...
// HANGS HERE
I am hoping to get the flutter tool installed and experiment with it for developing android and/or iOS apps. I have done some development using Xamarin in the Visual Studio 2017 but there is limited support for controls and I am
hoping that this tool will be more productive. IF there is anyone who can help me get past this problem I would appreciate any help. Thanks,
Rex
NEW INFORMATION BELOW:
I tried running the flutter doctor command in a command window with adminstrator privilege with the same result. It then tried editing the flutter.bat file with some echo commands to try to get additional information which showed me that the batch file was getting to the point where the following statement is executed:
>CALL "%dart%" %FLUTTER_TOOL_ARGS% "%snapshot_path%" %*
I edited the batch file to uncomment the lines assigning the FLUTTER_TOOL_ARGS which gave me additional information and the batch file exited as follows:
================== results in the command window =====================
>C:\Windows\System32>flutter doctor
>in acquire_lock ... # ECHO to get debug information
>in subroutine ... # ECHO to get debug information
>in after_subroutine ...# ECHO to get debug information
>dart - C:\src\flutter\flutter\bin\cache\dart-sdk\bin\dart.exe # ECHO dart
>FLUTTER_TOOL_ARGS ""--checked " --observe=65432" # ECHO FLUTTER_TOOL_ARGS
#next line is ECHO of snapshot_path
>snapshot_path C:\src\flutter\flutter\bin\cache\flutter_tools.snapshot
============== the following was output from the batch file =========
Unhandled exception:
Could not load "file:///C:/Windows/System32/%20--observe=65432":
FileSystemException: Cannot open file, path =
'C:\Windows\System32\ -->observe=65432'
(OS Error: The system cannot find the file specified. , errno = >2) null
# another ECHO
after CALL ... # echo to get debug information
================== end of results in the command window =====================
=========== ANOTHER NEW EDIT =============
Just to clarify the above edit, I totally deleted everything related to flutter and then re-installed/unzipped it in another directory "C:\src\flutter" which does not require admin privilege to edit, etc. but I did not delete the cache folder under the ..\AppData\Roaming\Pub directory as before so I am going back to do that this morning. I will also use the -v or -verbose option at the command prompt to see if there is any additional help and add the new information once done.
============== FOLLOW UP EDIT ================
I remove some of the debug ECHO statements, modified others, made sure 7z.exe is in the path, removed the cache directory but the results are basically the same as follows:
C:\WINDOWS\system32>flutter doctor -verbose
Show dart, FLUTTER_TOOL_ARGS, and snapshot_path:
dart - C:\src\flutter\flutter\bin\cache\dart-sdk\bin\dart.exe
FLUTTER_TOOL_ARGS ""--checked " --observe=65432"
snapshot_path C:\src\flutter\flutter\bin\cache\flutter_tools.snapshot
execute call to dart ...
Unhandled exception:
Could not load "file:///C:/Windows/System32/%20--observe=65432":
FileSystemException: Cannot open file, path =
'C:\Windows\System32\ --observe=65432' (OS Error: The system cannot find
the file specified., errno = 2)
null
returned from call to dart
exit code 255
C:\Windows\System32>
============ Another Update ===========
I decided to try the clone of the beta again since that was the most promising of all the previous things I did. When done I used the power shell and issued the "flutter channel" command just to see what that would do. Surprisingly I got a similar result to running "flutter doctor" previously. First there was an output at the top of the screen showing dart being downloaded and then when that was done the following was printed on the console below the original command:
C:\Users\rex>flutter channel
Checking Dart SDK version...
Downloading Dart SDK from Flutter engine
1ed25ca7b7e3e3e8047df050bba4174074c9b336...
Unzipping Dart SDK...
Updating flutter tool...
and then the console hung as before...
I finally aborted the command and set echo on in flutter.bat. That file hangs with the following command displayed on the screen (all on the same line):
C:\src\flutter>CALL "C:\src\flutter\bin\cache\dart-sdk\bin\dart.exe"
"--checked --observe=65432"
"C:\src\flutter\bin\cache\flutter_tools.snapshot" doctor
At this point I am pretty much at a loss.
Have tried the following?
Run the flutter doctor command from a command prompt with admin privileges?
Tried installing a different type of unzip program (like 7-zip) and ensuring it's in the PATH?
BTW I'm looking at this issue that seems similar to what you are describing: https://github.com/flutter/flutter/issues/11698
You can try to use the Flutter Console with Administrator Access Privilege and try to change the change the channel to the current stable version flutter channel stable
Then, once again run the flutter upgrade.
I hope this help you.
Seems like you don't have enough privilege to save or edit files in that directory.
Try to run your command prompt as admin or try to run your flutter console as admin and check if that helps.
May be Antivirus or Firewall blocking
try running windows in Safe mode and then run flutter commands
On Windows, the simplest and easiest way is, download the latest version Flutter SDK. Manually replace the current folder by pasting the downloaded flutter folder instead of the current folder in the C drive. Always choose "replace and paste".

Joomla: Blank site when uninstall a component

I have installed AdvancedModuleManager while trying to assign modules to certain pages. However It did not work as I wanted and when I tried to uninstall it from the Administration panel - the website gone blank.
Both /administrator/ and front end are blank.
Any ideas how to fix it?
[22-Apr-2016 21:25:36 Europe/Sofia] PHP Fatal error: require_once() [<a href='function.require'>function.require</a>]: Failed opening required '/home/public_html/libraries/regularlabs/helpers/functions.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/public_html/plugins/system/sourcerer/sourcerer.php on line 41
The problem was that I have installed another Plugin called "Sourcerer".
Both "Sourcerer" and "Advanced module Manager" are made from "Regular Labs" and when I uninstalled the AMM I also uninstalled their common component called Regular Labs Library...
Installed it again and everything was fine

Error -60005 when install Cocos2d-iPhone v3 RC4

When I try to install Cocos2d-iphone 3.0.0 RC4, I got an error: (run without sudo)
Error -60005 occurred while executing script with privileges.
So, I try to show its package content and use terminal to do: cd ...Cocos2D Installer 3.0.0.app/Contents/MacOS
I try this command: (with sudo)
sudo ./Cocos2D\ Installer\ 3.0.0
It works but I got log with some errors:
[1m>>> Installing Cocos2D-v3.0.0 files (B[m
[1m>>> Installing Cocos2D-v3.0.0 templates (B[m
[4m[1mCocos2D Template Installer (Cocos2D-v3.0.0)(B[m
Error: [31m✖︎(B[m Script cannot be executed as root.
In order for it to work properly, please execute the script again without 'sudo'.
If you want to know more about how to use this script execute '/Users/viethung/Downloads/Cocos2D-v3.0.0/install.sh --help'.
[1m>>> Building/Installing Cocos2D-v3.0.0 documentation, this may take a minute.... (B[m
appledoc version: 2.2 (build 963)
Generation step 4/5 failed: GBDocSetInstallGenerator failed generating output, aborting!
Documentation set was installed, but couldn't reload documentation within Xcode.
Xcode got an error: No documentation set present at specified path.
[1m>>> Cocos2D-v3.0.0 installation complete! (B[m
Are there any way is better than this way?
I have same problem.
I think you installed old cocos2d-iphone and it caused this problem.
You should remove old cocos2d-iphone first. I removed:
~/Library/Developer/Xcode/cocos2d v3.x
And install again. It works for me.
Hope it works for you :)

Resources