Why can't I create a Google Chrome extension from the CLI? - google-chrome

I'm a bit confused, but I can't create a .crx package from the CLI in Linux. In Windows 7 the script worked fine, but in Linux it seems that nothing happens. The popup window that occurs after the packaging process doesn't appear and the .crx is not created at all.
Here's the script.
#!/bin/sh
google-chrome --pack-extension=~/Web/client/ --pack-extension-key=~/Web/client.pem
exit 0
Maybe I'm missing something?

In Linux, (at least Ubuntu 10.04) google-chrome is a bash script wrapper of the chrome executable.
First, You should find where the chrome executable is. In my case: /opt/google/chrome/chrome
Then, replace it in your script:
#!/bin/sh
/opt/google/chrome/chrome --no-message-box --pack-extension=/extfolder/Web/client/ --pack-extension-key=/extfolder/Web/client.pem
exit 0
It is really important that in the script to specify the full path. For instance, /home/me/Web/client.pem rather than ~/Web/client.pem because as it is a parameter bash does not resolve it.
A better alternative would be defining a bash variable called $CHROME_PATH so it can be easily changed among different *nix platforms.

I don't know why packaging with google-chrome on Linux doesn't work, but can at least propose a workaround - use one of the officially-blessed packaging scripts listed at https://developer.chrome.com/extensions/crx#scripts. There is currently one for Bash and one for Ruby.

Related

Find latest available Chrome version (on Linux, eg from a shell script)

How can I find the latest version of Google Chrome from a shell script (e.g. bash) on Linux ?
For ChromeDriver, I can do this:
curl https://chromedriver.storage.googleapis.com/LATEST_RELEASE
Can I do something similar for Chrome?
Background to question
T
his needs to be done in a pipeline and there is no local install of Chrome, no tools to inspect packages (rpm, deb, and the like). The reason I want this is so that I can download the latest version as a numbered package. I could do this
wget -O https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
but that results in a file called google-chrome-stable_current_amd64.deb rather than one that is version stamped such as google-chrome-stable_73.0.3683.103-1_amd64.deb.
If I know the version in advance, I can get a version-stamped file using this:
GOOGLE_CHROME_VERSION=73.0.3683.103-1
wget http://dl.google.com/linux/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${GOOGLE_CHROME_VERSION}_amd64.deb
So what I'm really looking for is either generic URL that always returns the latest version-stamped file or a way to set GOOGLE_CHROME_VERSION in the above.
If you are using Ubuntu Desktop like mine 16.04, here is the command
google-chrome --version
ref. https://askubuntu.com/a/505532/22308

Octave gets stuck on Busy... inside TeXmacs in Windows OS

I have TeXmacs and Octave installed, both working properly otherwise. I have also added the path to octave executable (i.e. C:\Octave\Octave-5.1.0.0\mingw64\bin) to the Windows environment variables and octave runs in cmd/PowerShell terminals and Jupyter with no hassle. However, when running Octave inside TeXmacs through Toolbar > insert > session > octave it gets stuck on Busy..., the same reaction for any other commands as well:
Octave gets stuk on Busy... inside TeXmacs.
This is my environment:
TeXmacs 1.99.9
Octave 5.1.0 (installed through Chocolatey)
Windows 10 version 1809
I would appreciate if you could help me know what is the problem and how I can solve it.
P.S. I have reported this issue in the TeXmacs repo.
#Foad. I wrote an updated Octave plugin for Texmacs. I tried it on Windows, OSX and Linux, works on the systems I have access to. If you are interested to test it, you can download the zipped archive from here https://lists.gnu.org/archive/html/texmacs-dev/2019-12/msg00005.html.
To install it, unzip the archive and copy the octaveX directory in the application plugins folder, alongside all the plugins that come with the standard Texmacs installation. Won’t work if installed in ~/.Texmacs/plugins. If everything goes fine, you should find a new Insert/Session/OctaveX menu (note: I changed the session name). If not, try to refresh the plugin system with the menu Tools/Update/Plugins. If you try it, please let me know, especially if you find troubles. In case I will do my best to fix them.
A fundamental prerequisite is a working octave-cli command in a operating system shell. Should be standard on Linux, may require some additional setup on Windows (environmental variables) or OSX (.bash_profile). You can find some help and more details under the menu Help/Plug-ins/OctaveX.
Concerning the error you found, as far I understand there are some issues with the standard distributed plugin: first, a .octaverc file is missing, so several variables are not initialized, in addition the Windows version calls a not existent file. Moreover the plotting functions are quite old and are not compatibile with Octave newer than version 2 (or maybe 3, anyway a quite old version).
You could try to run the command in
%TEXMACS_PATH%/plugins/octave/bin/tm_octave.bat
from the terminal to see what happens. There is a problem with this plugin and it does not work also on Mac but I do not know enough Octave to fix it. Somehow it does not manage to find the files which are in
%TEXMACS_PATH%/plugins/octave/octave
Please try to modify tm-start.m to look like
d=getenv("TEXMACS_PATH");
if (length(d) > 0)
addpath("tm:polynomial:plot")
tmrepl
endif
In windows, octave should be run using the scripts octave.bat (in the mingw64\bin directory of the octave install) or octave.vbs (in the install directory) for the GUI
You should not run octave.exe directly.

Browser Automation using Bash On Ubuntu On Windows

We have a strong regression automation suite developed with Watir for Web Apps and Calabash for IOS and Android and so far our executions are happening on Mac OS.
We want to use RVM on Windows 10 so enabled bash feature on Windows 10 and installed RVM using Bash On Ubuntu On Windows. Using this installed RVM I would like to trigger the browsers installed on my Windows. I would like to know whether I am trying something that is possible ?
Just to check, I tried to trigger chrome browser in irb.
I placed my chrome driver below.
I have set my path and find the same below
On triggering chrome browser in irb I am getting the below error even though the path is set correct.
Selenium::WebDriver::Error::WebDriverError: Unable to find chromedriver.
I would like to know whether trying to trigger the browser installed on my windows environment through the Bash On Ubuntu On Windows terminal is practically possible attempt or not ? If so, please let me know where the disconnect had happened in my setup.
Below are the versions I am installed with .
rvm 1.29.3 (latest)
ruby-2.2.7
watir (6.8.4)
The error you are getting generally indicates that you have installed the chromedriver.exe file into a directory that is not on your path. Either move the file to a directory that is in the default path, or modify the path to add the directory with chromedriver.exe to the path.
Generally it's best to do that with the default path set by Windows on boot-up lest you have to have some batchfile that is run to alter the path before running IRB or a script that runs your tests.
Use the webdrivers gem. It ensures you always have the latest chromedriver.exe in your ~/.webdrivers directory, by downloading the newest version as necessary. It directs the Ruby code to use that driver regardless of what other chromedriver is on your system and whether it is or isn't on PATH.

MonoDevelop's debugger and xterm/gnome-terminal

I am using Xubuntu 15.04. I tried to run a basic console app using MonoDevelop, the latest one. I did a new project and this appears when I try to debug it:
Could not connect to the debugger
I googled for answers and I found out that there is a problem with the gnome-terminal, that it no longer accepts the --disable-factory argument and something about unchecking the "Run on external console". I unchecked that and when I press to run, it closed it immediately.
Try executing MonoDevelop as sudo
$ sudo monodevelop
It takes Xterm as output terminal emulator.
EDIT
Run Monodevelop as root can be a BIG mistake.
Best way is to write an script that unsets GNOME desktop session and run monodevelop, as Oskar says.
Try this one (copy and paste it on vim/nano and save as monodevelop.sh)
#!/bin/bash
unset GNOME_DESKTOP_SESSION_ID
monodevelop
Put it on your home (for example) and give it execution permissions:
chmod +x ./monodevelop.sh
When you want to run it, execute ./monodevelop.sh. Or you can add it as GNOME shell application following this guide.

How to configure Brackets.io Live Development to use Chromium instead of Chrome on OSX?

I would like to reuse already installed in the system Chromium browser and do not additionally install Chrome (because then I can't use Chromium at the same time - they share one profile folder by default on OSX, also for other reasons)
Here are ideas, the problem is - they are just conceptual, not ready to implement:
edit Brackets configs (didn't find much of them) to call Chromium (how it calls)
edit Chromium configs (to mimic the Chrome?)
use dev tools remote debugger and connect to created web-socket
create link to Chromium via: sudo ln -s ~/Applications/Chromium.app/Contents/MacOS/Chromium /usr/bin/google-chrome // didn't work
connect to the simple static server from the folder (via httpster) // didn't work
How is it possible to use Chromium instead of Google Chrome to use Brackets' Live Development feature?
On Mac, Brackets locates Chrome based on its bundle identifier. So in theory, if you hack Chromium's Info.plist to change its bundle id to com.google.Chrome (and I guess remove or patch any copies of Chrome that might collide with that) -- then Brackets should launch Chromium for you.
In the future, Brackets plans to make this more configurable as an official feature - but it's not there yet.