* * *

Author Topic: NPAPI plugins and plugin-container.exe in Lazarus  (Read 810 times)

DudePlyingDudeDisguisedAs

  • Newbie
  • Posts: 4
NPAPI plugins and plugin-container.exe in Lazarus
« on: October 07, 2017, 10:02:37 pm »
Hello,
I am looking into making a program involving browser plugin's and emulating certain functions so i can run these independent of a browser.

I want to run some NPAPI plugins in my app and i was wondering if anybody has any advice before i start.

would it be a good idea to use Mozilla's plugin-container.exe, its probably going to take some time to figure out how so i thought i would ask if it would be feasible.

Would this be a good way to use NPAPI in Lazarus?


Or should i do it some other way?
Quote

I might not be being very coherent so im adding some details about my planned program that aren't as relevant to my question

Im going for something that will be like an emulator so browsers pulling support is part of the reason for my app.
some of the things i want to do besides simply run the .jar, .swf, .dcr Etc

1. allow selective access to the internet
2. specify where the dll for the plugin is
3.Specify the URL the plugin thinks it is loading the cached file from
http://Http://Example.com/file.jar not FILE://c://file.jar
All of these things are handled outside plugin-container.exe so i guess i would be able to control these in my app


marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5875
Re: NPAPI plugins and plugin-container.exe in Lazarus
« Reply #1 on: October 07, 2017, 10:08:28 pm »
You know the next version of Firefox will drop npapi?

DudePlyingDudeDisguisedAs

  • Newbie
  • Posts: 4
Re: NPAPI plugins and plugin-container.exe in Lazarus
« Reply #2 on: October 08, 2017, 11:32:34 am »
Browsers dropping support for plugins is the sole reason for my program!
I will be copying and possibly modifying the plugin related components separate from the browser either way
Its a bit like an emulator

Graeme

  • Hero Member
  • *****
  • Posts: 1419
    • Graeme on the web
Re: NPAPI plugins and plugin-container.exe in Lazarus
« Reply #3 on: October 12, 2017, 05:47:09 pm »
I am looking into making a program involving browser plugin's and emulating certain functions so i can run these independent of a browser.
I want to run some NPAPI plugins in my app and i was wondering if anybody has any advice before i start.

Many years ago (circa 2006/7) I did just that. I shared the code on SourceForge. I primarily created the component to enable Adobe Flash and Acrobat PDF viewing inside our desktop applications. It worked back then (under Windows and Linux), but I haven't touched that code in years. You are welcome to take the project further. If you want write access to the repository, just send me a private message (here or via SourceForge).

  https://sourceforge.net/projects/mozpluginpanel/

PS:
  I can move the project to GitHub too, or convert it to a Git repository (on SF.net) if SubVersion is not ideal. I don't use SubVersion at all any more.
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

DudePlyingDudeDisguisedAs

  • Newbie
  • Posts: 4
Re: NPAPI plugins and plugin-container.exe in Lazarus
« Reply #4 on: October 15, 2017, 11:39:15 am »
Many years ago (circa 2006/7) I did just that. I shared the code on SourceForge. I primarily created the component to enable Adobe Flash and Acrobat PDF viewing inside our desktop applications. It worked back then (under Windows and Linux), but I haven't touched that code in years. You are welcome to take the project further. If you want write access to the repository, just send me a private message (here or via SourceForge).

PS:
  I can move the project to GitHub too, or convert it to a Git repository (on SF.net) if SubVersion is not ideal. I don't use SubVersion at all any more.
Thankyou!
I will try it out in my project and let you know how it worked.
Quote from: Sf.net Malebranche
Nice component! It's sad that it isn't updated. I tried to replace NPSWF32.dll by the current version (found in C:\Windows\System32\Macromed\Flash\). I replaced the name of the DLL in the code and compiled it with Lazarus 1.4.2. Unfortunately the program crashed.

Posted 09/27/2015

Not shure if his bug relates to filenames in code or some obscure thing in NPAPI that has been changed since.

I have some time to work on this in the next week and I will let you know how it went.

Update: didnt have this bug when i tried it and i got flash player 27 running so it must have been something else!

Screenshot
https://postimg.org/image/1jzxq3b5a3/
It behaves a bit different to the Flash ActiveX on default settings mainly itsnot set to "loop" and "play" which is a good sigh since there are a few things incompatible with this mode or projector despite running fine in browser.

now that ive got it working i will see how it handles Java
« Last Edit: October 15, 2017, 04:43:56 pm by DudePlyingDudeDisguisedAs »

Graeme

  • Hero Member
  • *****
  • Posts: 1419
    • Graeme on the web
Re: NPAPI plugins and plugin-container.exe in Lazarus
« Reply #5 on: October 15, 2017, 11:15:33 pm »
Update: didnt have this bug when i tried it and i got flash player 27 running so it must have been something else!
Screenshot
https://postimg.org/image/1jzxq3b5a3/

That's awesome, and thanks for the feedback. I think I last used it with Flash 9 - so pretty impressed that it still works with Flash 27.  :)

As for Java - I don't think I ever tested it with Java, but I guess if I implemented all the NPAPI calls, it should in theory work with any NPAPI plugin.

Either way, glad it works. And as I mentioned, my offer still stands. If you want to take this project further, just let me know and I'll give you write access. For example: I can't remember off the top of my head if I managed to implement passing values to Flash and retrieving values from Flash. I remember that become a requirement later in our desktop application, but I can't recall if I implemented that in MozillaPluginPanel.
« Last Edit: October 15, 2017, 11:19:19 pm by Graeme »
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

DudePlyingDudeDisguisedAs

  • Newbie
  • Posts: 4
Re: NPAPI plugins and plugin-container.exe in Lazarus
« Reply #6 on: October 16, 2017, 01:44:20 am »
Either way, glad it works. And as I mentioned, my offer still stands. If you want to take this project further, just let me know and I'll give you write access.

I am probably too much of a novice programmer to help your project in any meaningful sense.
Thus far ive only briefly tested the code, so far i haven't even got it to "Play" and "Loop" yet hopefully i can get this going on my day off!
(Got other projects and working full time ATM),  i tested it by adding controls to my Swf as this was the fastest way

Im not sure if i would be able to add much to it.
You mentioned having trouble under Linux
Quote from: Readme.txt
+ This project is still in pre-alpha status.
+
+ I have had moderate success under Windows with the Acrobat Reader
+ and Flash Player plugins. Unfortunetaly I am still battling
+ under Linux, but another developer has reported some success
+ with modifications not in this repository.
Ive only ever made programs for Windows so i probably wouldn't be able to do anything for Linux,
Though i do want that to work as it would come in handy.

My plan is to make the program for Windows iron out bugs and thoroughly testing the code.
once i know it works see if it can be ported to linux.

First got the idea to make a program for running plugins when something needed java but chrome wouldn't work with it, After the whole Flash 2020 thing i knew something needed to be done.
For example: I can't remember off the top of my head if I managed to implement passing values to Flash and retrieving values from Flash. I remember that become a requirement later in our desktop application, but I can't recall if I implemented that in MozillaPluginPanel.
My plan for the HTML in the <object> and <applet> was to create an INI with all applicable data such as size scale Quality etc, Flashes that interact with the Html are quite rare but it is something i keep in mind

its mainly for software preservation as sites like this for example, wouldn't work with the "Flash Projector" or the Ocx(in app)
http://host-d.oddcast.com/php/application_UI/doorId=137/clientId=49/
The games and movies created for plugins are just as worthy of preservation as any DOS or console game yet there is no serous attempt at an "emulator"

as these will never work on archive.org,
but archival is still possible as if all files are downloaded and what information the app try's to retrieve from the net can be redirected/intercepted(by my app) a ROM could be created.

Hell you could even have a stripped down Linux in WebAsm virtual pc running a program like what i have in mind and it would be almost identical to the original, that would be a bit bloated but if moores law applies...
Html 5 content is usually larger in file size anyway not to mention the enormous size difference in video files and native vector based flash movies

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus