I searched all Internet but can't find any example of working NPAPI plugin (in Objective-C for Mac OS) which is called from Google Chrome Extension. I'm very want to get such Xcode example, please help if someone have one.
You don't actually need one example plugin that does all those things; how an NPAPI plugin is implemented internally has no effect on how it's called from the browser. The API is always the same C API.
Start with a simple Mac plugin (like this one), change the .c to a .m (or add new .m files), and use as much Objective-C as you like in the implementation.
Then once that's built, follow the instructions for using an NPAPI plugin in a Chrome extension.
Related
Xcode8 now officially support editor extensions, and forbids code injection, preventing previous extensions (served by Alcatraz for example) to execute.
It may be a dumb question, but I'm totally unable to find an answer:
Where can I search for existing Xcode8 extensions?
For example, with Alcatraz there was a panel in Window > Extensions, which presented a list with all available extensions. With Xcode 8.0 (official release) there is no such option.
In WWDC video, the guy talks abound downloading them from the mac App Store. But again, I'm unable to find a category or any one of them.
(note: I'm still on El Capitain)
This is all I could find:
Awesome native Xcode extensions
Xcode-8-extensions
The Xcode extensions can be found on the App Store, for example i have been able to find this one: Text Toolset
They have to be enabled after installing by going to the system preferences > extensions.
Overall they are really hard to find, as they do not have a separate category on the App Store.
I can detect if my Opera extension installed by setting the new window object property (window.isExtensionInstalled for example) in injected script and checking it in web-page javaScript.
But this is not solution in case the extension is disabled.
How can I detect disabled extension?
Are there features like resources web-access in same manner as for Chrome extensions?
May be some other useful features?
Thanks in advance.
No, there is no such feature.
By definition, each extension lives in its own sandbox and is not aware of other extension.
The only chance is to look out of the window (object) and search for footprints (modifications of the window or child objects) of other extensions.
If these are forced to stay at home (deactivated), the can't leave footprints..
Sry for being so figurative ;)
I would like to learn how to extend JavaScript functionality by adding some plug-ins to webkit based browsers.
Any link or tutorial from where I can start.
I looked into http://rvr.typepad.com/wind/2011/10/webkit-extending-javascript-1.html
but it used GTK+, I am looking webkit enhancement in C/C++
Seems you have some confusion...
Why did you tag this "firefox-addon" and "firefox-addon-sdk" when Firefox is not Webkit based? (It uses Gecko).
Also, GTK+ is a C++ wrapper over the C interface to a GUI toolkit. (?)
If you want some good opportunities to mess with WebKit, you can install Qt Creator and try out their WebKit examples, which include plugins as well as some more basic integration:
http://qt-project.org/doc/qt-4.8/examples-webkit.html
You should read up on NPAPI/PPAPI if your goal is to write plugins for existing web browsers:
http://en.wikipedia.org/wiki/NPAPI
I've been reading about how to create a new plugin for Phonegap and seems to get it by following this tutorial.
http://wiki.phonegap.com/w/page/36753496/How%20to%20Create%20a%20PhoneGap%20Plugin%20for%20iOS
However, I'm having a hard time grasping how to extend an existing plugin. (not creating a new one)
Been reading this tutorial.
http://hiediutley.com/2011/03/28/phonegap-tutorial-series-3-extending-the-phonegap-api/
I can't seem to get where I can possibly add line of codes to the .m file for example. In my XCode, I only see the .h files but not the .m file.
Or is there a better way to extend an api?
Thank you,
Tee
EDIT: This answer is no longer completely correct.
The latest versions of Cordova / PhoneGap do not come as a compiled framework and it is much easier (especially since 2.2.0) to tweak the version of cordova a particular app uses as it is simply a sub-project in XCode.
To get at the .m files you would have to download the PhoneGap (Cordova) iOS source and make your changes them compile your own version of the PhoneGap framework.
That is not as hard as it sounds, but can be a bit daunting if you are not super comfortable with Objective-C and command line compilation tools.
To paraphrase the README from the iOS source, for example:
$ git clone http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios.git
Make your changes, then...
Launch "Terminal.app"
Navigate to the folder where the Makefile is (./PhoneGapLib ?)
Type in make then press Enter
This should build "PhoneGapInstaller.dmg" into the dist folder. This is what you use to install your new version of PhoneGap.
Another option is to take the .m and .h files of the API you are extending (by simply getting them from the GitHub source repository) and making them into a new plugin with your own name. As an example, rather than extend the Camera API and make changes to Camera.m and recompile etc... I chose to make a plugin unoriginally called MyCamera that had the code from the Camera API and my own extensions. Most of the APIs in PhoneGap (at least in iOS) are basically already plugins in their own right, so they don't need much tweaking to be turned into a plugin just for your purposes.
This method also means you can upgrade PhoneGap later and not clobber all your extensions.
I'm developing an app on MASM using the RadASM IDE. This IDE comes with an IE control (WebBrowser) but the content that I want to display is broken on that browser (XHTML+CSS), also I want to remove the dependency of an external IE dll so the only solution that comes to my mind is use an engine of other browser like Firefox or Chrome.
I've searched over the net and I found some DevKits that meets my requeriments, but they are designed to work with VS2005+ or they just are coded on C++.
If someone know a way to integrate a browser engine (Not IE) to a MASM app, will be highly appretiated.
I doubt you will find any browser SDK that specifically helps you call it from assembly language. Almost nobody actually writes applications in assembly language today. However, C is pretty close to assembly, so all you have to do is use the instructions for C and translate to assembly language. Since you're already writing an application in assembly language, that should be no trouble for you.
You can use any SDK that comes with pre-compiled binaries using the WinAPI functions LoadLibraryA and GetProcAddress. Or you can build your own import libraries for MASM by following what either Iczelion did write on that topic (definately worth a read) or by reading the 3 part guide on my website, which is based on Iczelions guide but works on a live example, namely creating your own MASM import library for the FMOD API.
Weather it is worth all the hassle is another question.