cross-browser server side web app logging library - debugging

To send debug messages from our web application to the browser, we have Firebug+FirePHP for Firefox, as well as Chrome Logger for Chrome/Chromium. FirePHP for Chrome does not work with the latest Chromium/Chrome versions and does not seem to get developed anymore.
Unfortunately, both tools are incompatible because they use a different format and thus require different server-side libraries.
Is there a way to make them compatible, or an alternative that works across browsers?

Webug for Chrome implements the FirePHP protocol, so FirePHP can be used cross-browser now.

Related

Extension support browser.runtime.connectNative

We want to use extension replace with plugin, but we need use extension to download files and launch the file such as exe file.
Is there a method to do?
As pages said, Firefox extension will compate with Chrome's extension, we found Firefox support most APIs, but do not support runtime.connectNative() and some native APIs.
Does Firefox support them? If support, when will support? And how to support Native's extension?
The native messaging API is not yet implemented in Firefox WebExtensions, but it's on the future roadmap.
In the meantime, you can use the older SDK API system/child_process to communicate with external binaries over a pipe interface.
Also, if you want to contribute an implementation of native messaging to Firefox WebExtensions, I will happily introduce you to people who can help with mentoring and code review.
The Firefox WebExtension API will support connectNative() from version 50 on. The documentation is already available. You can try out the API using Firefox Developer Edition 50.

"Bundle" selenium application with browser?

Basically I'm going to distribute my Selenium program to a number of clients for automation purposes.
Rather than asking every customer to have FireFox installed (and risking possibly incompatible versions) I would prefer if I could have FireFox (or whatever browser) packaged in my program directory (perhaps a portable version).
All my customers will be using Windows btw.
Anyone tried this or have any suggestions to how this could be accomplished?
EDIT: I suppose I could use PhantomJS with selenium and just package my software with the phantomjs driver. That would not require any external browsers to work, would it?
You have also HTMLUnit headless browser option. Please note that it has own proprietary JavaScript rendering engine so need ensure that your test also will work with the "regular" browsers.
Another option is to use Selenoid and Docker for Windows. Your customers could download easily removable images with browsers (no need to clutter Windows with browser files) and run your test suite in multiple containers in parallel.

How can I send a message from Google Chrome extension to desktop application?

I have a Windows desktop application which must work in collaboration with my Chrome extension.
Can I send a message to my desktop app somehow from Google Chrome extension?
Which IPC objects can I use?
I see three options:
You could use the internet. You can have a remote service that both the chrome extension and your desktop app talk to, to communicate.
You could have your desktop app have a simple server built into it so that the chrome extension can make local http requests to it to communicate with it.
Use the Google NPAPI plugin functionality to have full access to the computer. Now deprecated
These days you would use Chrome's native messaging API to send the message from your extension to a native messaging host. The latter can be a "real" executable that then passes the message on to your desktop application.
Documentation: http://developer.chrome.com/extensions/messaging#native-messaging-host
chrome extension has a native massage api to communicate to native process,
see here:
https://developer.chrome.com/apps/nativeMessaging
This almost certainly requires a custom NPAPI plugin and cannot be done with the basic extension API. NPAPI development is fairly daunting and outside my area of expertise, but feel free to read over Google's documentation on the subject.
As an alternative, perhaps you can have your desktop application poll the internals of the extension. For example, the extension's could have a file in its sandboxed filesystem where it leaves messages for the desktop application to find. This approach is suboptimal, since it requires polling instead of pushing, but it does save you the hassle of coding an NPAPI plugin.

Call external executable from NPAPI on OS X?

I'm developing an application (download manager-type) on OS X that I would like to integrate with the major Mac browers (Safari, Firefox, Chrome, Opera, Camino) via the Mozilla plug-in API, NPAPI. I have a basic understanding of how to register my app on the Mac to handle specific URL's and file types (via the Launch Services API, the info.plist file, etc.), and I also understand that I can register for specific MIME types in the NPAPI. However, I see almost no hooks in the NPAPI docs for integration with external applications, i.e. getting a URL via NPN_GetURL() when a hyperlink is clicked and passing this data on to an external application. The only references I've found to calling external applications is the system function in C, and I'm finding it hard to believe this is the only way it can be done. I know that other Mac apps (download managers) are able to integrate with browsers in this fashion, but there seems to be very little documentation about it. Am I misunderstanding the purpose of the NPAPI?
Yes, you are misunderstanding NPAPIs purpose. For things like intercepting clicking of links and changing the browsers behavior you need to write browser extensions, not a plugin.
See:
Plug-ins and extensions
Browser Plugins vs Extensions – the difference
The actual API of NPAPI is very limited; much of what plugins do they do through direct system calls. system isn't your only option—you can use anything you would use any any OS X application (NSWorkspace, Apple Events, IPC to a launchd-registered service, etc.)—but you won't find a call in NPAPI to do what you want.

How can I embed firefox in a GUI application?

Has anyone ever embedded the firefox web browser technology in their own [unmanaged] C/C++ GUI application in the same way that IE can be embedded as a COM object? (I would like to do this on Linux, not Windows). Are there "better" alternatives to firefox? I'm open to anything as long as I can use it with non-GPL code. My needs are fairly basic; I only need fundamental HTML parsing and display of static local files, but I'd take advantage of more sophisticated technology, if I can get it. I'd like to be able to use JavaScript, but I can get by without it.
First you need to differentiate between HTML engine and JavaScript Engine.
Firefoxs HTML rendering engine is called Gecko. And here is a guide about Embedding Gecko in your application.
Firefoxs JavaScript engine is called SpiderMonkey and here is How to Embed SpiderMonkey in your C application
Check out webkitgtk. It's not Gecko, but Webkit based. It basically provides a web browser widget that can be used in GTK+ applications. If you want to embed mozilla, there are things in the mercurial repositories for Mozilla repository that let you do it, but it didn't seem heavily supported last I checked.
as stated by Mozilla
Embedding of Gecko is no longer supported
so have a look on either previous mentioned Chromium Embedded Framework or WebKit. Alternatively, you can follow Mozilla's new project https://servo.org/.
You will find some more up to date information on Is it possible to Embed Gecko or Webkit in a Windows Form just like a WebView?
It is possible to use parts of Firefox (such as the Gecko renderer) in other apps. There are various approaches to this, including wxWebConnect, a web browser control for wxWidgets. See also Embedding Gecko
Another popular solution is WebKit. Again, there are various ways you can use this, including QtWebKit (a wrapper for the Qt toolkit) and webkitgtk (already mentioned by SB).
Have a look at CEF (Chromium Embedded Framework). It is very similar to WebKit and it also has built-in HTML and JavaScript engines embedded but has better WebGL and HTML5 Canvas support. It is released under BSD license.

Resources