After trying everything, I too have filed a new bug with the Opera Bug Wizard. The Opera Bug Wizard did not give me a Bug Number. All I got was this:
DNAWIZ-3797.
The remainder of this post is the text of my bug report.
Summary
I have developed browser extensions for many years, including one for Google Chrome, which uses their Native Messaging API. Even though Vivaldi does not provide any documentation, it works in Vivaldi the same as it does in Chrome, with obvious changes. I was able to install my extension and get it working in Vivaldi in less than an hour. But I cannot get it to work in Opera, and after trying every reasonable variation on the ambiguities in the documentation, I have concluded that the Native Messaging API does not work in Opera when running in mac OS (OS X). I am using Opera version 38.
Details
When my extension runs in Opera, the line of JavaScript code which is supposed to open a port,
port = chrome.runtime.connectNative(hostName);
executes successfully (without raising) in a try{} block, and returns what appears to be a port object, but its properties are rather empty, and my native binary does not launch, as it does when my extension runs in Google Chrome or Vivaldi.
In looking at that documentation, I find it strange that my I am told to install my Native Messaging manifest file here:
- /Library/Google/Chrome/NativeMessagingHosts/com.mycompany.myapplication.json
First of all, the Google/Chrome subdirectory is owned by, you know, the wrong browser company. Second, because this path does not begin with a tilde (~) it is, eeeek, in a system-admin level directory. Because of this, I had to enter my administrator password twice in order to create the folder and put it there. Google Chrome gives you the option to put it in the user's directory instead, which I do for my Chrome extension.
I also tried putting my Native Messaging manifest file in other reasonable locations:
- ~/Library/Google/Chrome/NativeMessagingHosts/
- ~/Library/Application Support/com.operasoftware.Opera/NativeMessagingHosts/
- ~/Library/Application Support/Opera/NativeMessagingHosts/
but none of these worked either.
In addition to the Google/Chrome path mentioned above, there are other indications that this documentation was never thoroughly reviewed and tested, for example,
Chrome starts the host in a separate process…
Obviously, this should have been changed to:
Opera starts the host in a separate process…
To resolve this issue, Opera staff should please review the documentation and make corrections as necessary so that they can make a simple example extension which works, and post a link to it in the documentation. Maybe I'm making some silly mistake, but, you know for something like this, with multiple moving parts, a working example is essential.
Thank you for reading.
Jerry Krinock