topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Saturday March 30, 2024, 1:25 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Last post Author Topic: FScript2, a new way to build javascript plugins for FARR  (Read 32788 times)

ecaradec

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 410
    • View Profile
    • Blog & Projects
    • Read more about this member.
    • Donate to Member
FScript2, a new way to build javascript plugins for FARR
« on: January 08, 2011, 05:09 AM »
I've completed a first beta version of fscript2. Too bad, I'm a build too late for NANY ;)

FScript2 is a new way to write plugins for FARR in javascript, vbscript, and possibly other active scripting languages. FScript did that but it had a number of shortcomings. In particular, it was difficult to maintain and especially to update. FScript2 should solve that.

What it does

FScript2 load all fscript plugins under one master DLL. Other than that FScript2 does the same thing that FScript does, but it does them so much more neatly ;) :

- This means that once FScript2 is installed, an fscript plugin can be as light as a single fscript.js.
- This should also make plugins much lighter in memory since there will be only one DLL that control all plugins.
- This also means that FScript2 will be updatable by DCUpdate so there won't be a need for plugins scripter to repackage their plugins with my latest DLL, which has caused a lot of issues as I fixed bugs progressively.

How to use it

FScript2 is compatible with FScript plugins. To allow an FScript2 plugin you must delete the fscript.dll from that plugin.

Copy FScript2 inside the plugin folder. FScript2 will try to detect plugins one folder under its installation folder : If you install it into 'plugins/Fscript2', it will scan every folder under the 'plugins' folder seeking for fscript.js files.

To enable thoses plugins to use FScript2, fscript.dll must be deleted inside each plugin. Folder that contains an fscript.dll file will be ignored.  This is a security and should help with the transition : If some plugin doesn't work with FScript2, restore its original dll, and everything will work again.

Launch FARR and it should load plugins as if they were natives FARR plugins.

Extra notes

FScript2 create proxy dll for each FScript2 plugins. They are very small 10k DLL, that forward all call to the DLL. Theses DLL are created inside the proxy folder inside the FScript2 folder. This means that, that folder must be writable, so that FScript2 enable plugins. If you have some warning telling you that some plugins can be copied, you might have to fix that.

Some FScript plugins doesn't seems to work, but I'm unsure if this came from the plugin or from Fscript2 as they do not seems to work correctly with Fscript either. I'll be very happy to have some report of what works and what doesn't. Retesting all fscript plugins with fscript2 is beyond what I can do, so testers are welcome.

Try it
Get FScript2 here.
Blog & Projects : Blog | Qatapult | SwiffOut | FScript
« Last Edit: January 08, 2011, 06:17 AM by ecaradec »

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • View Profile
    • Donate to Member
Re: FScript2, a new way to build javascript plugins for FARR
« Reply #1 on: January 08, 2011, 08:33 AM »
Works well for me, thanks for the effort!

(a few DC credits coming your way)

ecaradec

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 410
    • View Profile
    • Blog & Projects
    • Read more about this member.
    • Donate to Member
Re: FScript2, a new way to build javascript plugins for FARR
« Reply #2 on: January 08, 2011, 08:41 AM »
Thanks, your credits are very appreciated. It has been an epic fight to shape all that code into that proxy dll stuff ;)
Blog & Projects : Blog | Qatapult | SwiffOut | FScript

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • View Profile
    • Donate to Member
Re: FScript2, a new way to build javascript plugins for FARR
« Reply #3 on: January 08, 2011, 08:45 AM »
PrinterList plugin doesn't work.
Subsequent to that search for plugins in FARR shows empty (unloaded), as it should but then anything I try to do with FARR throws an access violation error and I have to kill the process to escape.

TimeZone works
ProcessInfo works (I think). It loads but I can't get at it due to the issue mentioned above. Once Printerlist fails to load things go bad.

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • View Profile
    • Donate to Member
Re: FScript2, a new way to build javascript plugins for FARR
« Reply #4 on: January 08, 2011, 08:51 AM »
Yep, I spoke too soon about it working.

With Timezone and ProcessInfo loaded, and PrinterList removed, if I try to look at the plugins through the FARR interface I get an error and the only way I can get out is to kill the FARR process.

Let me go back to the old way and make sure that wasn't happening before (I don't spend a lot of time looking at plugins in FARR ;D)

I just reverted to the old way. Problem gone. It's fscript2, I hate to tell you.

On my system, once fscript2 is loaded I can't exit FARR normally, even without trying to look at plugins.

I'm on XP SP3.
« Last Edit: January 08, 2011, 08:59 AM by cranioscopical »

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • View Profile
    • Donate to Member
Re: FScript2, a new way to build javascript plugins for FARR
« Reply #5 on: January 08, 2011, 09:05 AM »
Here's my plan… I'll change my name to Jonah and move back to Whales.

What else can I do to help?

ecaradec

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 410
    • View Profile
    • Blog & Projects
    • Read more about this member.
    • Donate to Member
Re: FScript2, a new way to build javascript plugins for FARR
« Reply #6 on: January 08, 2011, 09:50 AM »
I tried to reproduced it on XP SP3 as well, but couldn't, but it might be some subtle combination of installed plugins ? What plugins are you running ?





Blog & Projects : Blog | Qatapult | SwiffOut | FScript

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: FScript2, a new way to build javascript plugins for FARR
« Reply #7 on: January 08, 2011, 11:14 AM »
whoa this is a surprise!!! can't wait to try it.

it sounds like you are inventing a whole new thing -- very interesting and challengine.

i only hope you do not lose your sanity in the process!   :-*
« Last Edit: January 08, 2011, 11:16 AM by mouser »

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • View Profile
    • Donate to Member
Re: FScript2, a new way to build javascript plugins for FARR
« Reply #8 on: January 08, 2011, 11:23 AM »
I tried to reproduced it on XP SP3 as well, but couldn't, but it might be some subtle combination of installed plugins ? What plugins are you running ?

These

FARR plu-ins.png

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: FScript2, a new way to build javascript plugins for FARR
« Reply #9 on: January 08, 2011, 11:27 AM »
so i have a question, if we assume on some machines it wont be possible for fscript2 to create the proxy dll, would one solution simply be to copy in the proxy dll manually?

and would this be a reasonable approach for new fscript2 based plugins? to simply include the proxy dll with their plugin?

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: FScript2, a new way to build javascript plugins for FARR
« Reply #10 on: January 08, 2011, 11:40 AM »
separate question is..

it sounds like youve created something extremely clever -- that lets existing plugins still THINK they are loading the fscript.dll but really are loading the new one through a proxy.

but here is my question about a possibly simpler solution:

since dll's are actually made to be shared if the same dll is in the search path, might a simple solution be for me to just have the core FARR load the fscript.dll from it's own program file directory (included with future farr builds) and add that directory to the dll search path?

does that solve the main problem of having ONE centralized fscript.dll or fscript2.dll that will be updated when needed, and preferably included with FARR install?

ecaradec

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 410
    • View Profile
    • Blog & Projects
    • Read more about this member.
    • Donate to Member
Re: FScript2, a new way to build javascript plugins for FARR
« Reply #11 on: January 08, 2011, 11:54 AM »
Yes creating DLL by hand is possible and will work. Actually you only need write access when you add a plugin, remove a plugin or if fscript2 changed and it need to write a new version of the proxy. If you're not adding, removing or updating plugin you should be fine.

However I'd rather keep the proxy with the master DLL otherwise we could end up with various versions. There is very few code in them, but not none at all and it would be problematic if you needed to add new FARR API as I'd need to implement them in order to forward them and then all proxy would need to be modified. It is also important that they are located in a subfolder of fscript2 as they must be loaded AFTER fscript2 to be able to initialize correctly.

One way to solve it would be that FARR support some kind of proxy for DLL like a file that would point to the DLL to load instead or even better an API for FScript2 to allow it to load plugins. The alias wouldn't solve the write issue, but the API would. I wanted a version that works for every versions of FARR first so I went this path first.

We could wait a little to see if I can fix them that way and see the issues before moving to something else.

I'm already half crazy anyway ;)

Blog & Projects : Blog | Qatapult | SwiffOut | FScript
« Last Edit: January 09, 2011, 12:57 PM by ecaradec »

ecaradec

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 410
    • View Profile
    • Blog & Projects
    • Read more about this member.
    • Donate to Member
Re: FScript2, a new way to build javascript plugins for FARR
« Reply #12 on: January 08, 2011, 11:56 AM »
separate question is..

it sounds like youve created something extremely clever -- that lets existing plugins still THINK they are loading the fscript.dll but really are loading the new one through a proxy.

but here is my question about a possibly simpler solution:

since dll's are actually made to be shared if the same dll is in the search path, might a simple solution be for me to just have the core FARR load the fscript.dll from it's own program file directory (included with future farr builds) and add that directory to the dll search path?

does that solve the main problem of having ONE centralized fscript.dll or fscript2.dll that will be updated when needed, and preferably included with FARR install?

That's sound nice but I didn't exactly get you. Can you rephrase it ?
Blog & Projects : Blog | Qatapult | SwiffOut | FScript

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: FScript2, a new way to build javascript plugins for FARR
« Reply #13 on: January 08, 2011, 12:15 PM »
Well what i was saying was simply this:

Let's first start at the begining:
  • Fscript (and FSubScript) is one of the most brilliant things ever invented.

But it has one problem:
  • As currently used, each plugin loads its own different copy of fscript.dll
  • This causes problems because when fscript.dll gets updated, some plugins have older fscript.dll versions and they may have bugs.

The basic idea of the solution:
  • Have all fscript-based plugins share the same dll.

And the specifics:
  • Can't we just put a single fscript.dll in the FARR main directory and include it with all farr releases, and have farr tell windows that when a farr plugin loads, to use that version of fscript.dll for the plugin?  Wouldn't that be simpler? Or is there a problem with that that i'm not understanding.

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • View Profile
    • Donate to Member
Re: FScript2, a new way to build javascript plugins for FARR
« Reply #14 on: January 08, 2011, 01:01 PM »
I've been trying to drop plug-in items from FARR one at a time.
I had fscript2 working with just 1 plug-in (TimeZone - thanks Perry) but then FARR threw an error as soon as I tried to look at the plug-ins list.

ecaradec

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 410
    • View Profile
    • Blog & Projects
    • Read more about this member.
    • Donate to Member
Re: FScript2, a new way to build javascript plugins for FARR
« Reply #15 on: January 08, 2011, 01:43 PM »
mouser you're a master at praising then critisizing...

If this could work, it would be wonderful.

I'm not sure how it could work within the current FARR plugin system although, loading several times the same DLL would not create different plugins in memory. Each API call would then need to be modified to add some context (the hostptr probably) to know which plugin it refers too. (An easier solution could be to add method to query the actual hostptr, that would at least avoid to duplicate the whole plugin API, but you'll have to set it carefully before doing any call to plugins )

At that point the FARR plugins would be able to embed multiple plugins inside one and fscript2 could be located anywhere...

May be I miss something ?
Blog & Projects : Blog | Qatapult | SwiffOut | FScript

ecaradec

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 410
    • View Profile
    • Blog & Projects
    • Read more about this member.
    • Donate to Member
Re: FScript2, a new way to build javascript plugins for FARR
« Reply #16 on: January 08, 2011, 01:45 PM »
I've been trying to drop plug-in items from FARR one at a time.
I had fscript2 working with just 1 plug-in (TimeZone - thanks Perry) but then FARR threw an error as soon as I tried to look at the plug-ins list.
-cranioscopical (January 08, 2011, 01:01 PM)

Thanks, I've found that I've outdated plugins, may be this is why I can't reproduce this issue. I'll try to find the exact same version. Which version of FARR do you have btw, if I have the exact same setup I should get it dammit ;) ?
Blog & Projects : Blog | Qatapult | SwiffOut | FScript

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • View Profile
    • Donate to Member
Re: FScript2, a new way to build javascript plugins for FARR
« Reply #17 on: January 08, 2011, 02:34 PM »
Thanks, I've found that I've outdated plugins, may be this is why I can't reproduce this issue. I'll try to find the exact same version. Which version of FARR do you have btw, if I have the exact same setup I should get it dammit ;) ?

v2.93.01

FWIW, whatever combination of plug-ins that I've tried here, causing an ugly with fscript2/FARR, has been corrected by reverting to the old system.
I haven't tried with no plug-ins at all — should I do so?

Mouser's praise for you is first probably because it's so well deserved  :Thmbsup:

ecaradec

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 410
    • View Profile
    • Blog & Projects
    • Read more about this member.
    • Donate to Member
Re: FScript2, a new way to build javascript plugins for FARR
« Reply #18 on: January 09, 2011, 01:05 PM »
I tried to reproduce your problem cranioscopical... I have setup the exact same combination of plugins but I don't get crashes. The only thing that seems different is that timezone keeps showing me the following message :

---------------------------
TimeZone Data Download
---------------------------
No records extracted. The datafile has not been written. The days not parsed:
Please see DayName_Log.txt and adjust the INI file.

Other than that it seems to work. I think we need someone else to test to know if there is something special on my PC or yours.
Blog & Projects : Blog | Qatapult | SwiffOut | FScript

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: FScript2, a new way to build javascript plugins for FARR
« Reply #19 on: January 09, 2011, 01:45 PM »
I'm not sure how it could work within the current FARR plugin system although, loading several times the same DLL would not create different plugins in memory. Each API call would then need to be modified to add some context (the hostptr probably) to know which plugin it refers too.

ah i see, i knew it was too simple an idea.

ok i will start helping to test fscript2.

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • View Profile
    • Donate to Member
Re: FScript2, a new way to build javascript plugins for FARR
« Reply #20 on: January 09, 2011, 01:56 PM »
I think we need someone else to test to know if there is something special on my PC or yours.

Sorry you've had a hassle. I agree with you, let's wait to see how others get on.
Thank you for working so hard on this!

(I had the same message from TimeZone and, because I'm busy at the moment, I simply dropped back a couple of versions pro tem.)
 

ecaradec

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 410
    • View Profile
    • Blog & Projects
    • Read more about this member.
    • Donate to Member
Re: FScript2, a new way to build javascript plugins for FARR
« Reply #21 on: January 13, 2011, 01:17 PM »
Did someone tried ? It's still a bit experimental but it would really help if I had some extra reports. It would be a good thing for FARR as well as it would be an exit for FScript past issues. At least if you have some issue with fscript, it could be good to check if fscript2 fix them.
Blog & Projects : Blog | Qatapult | SwiffOut | FScript

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: FScript2, a new way to build javascript plugins for FARR
« Reply #22 on: January 13, 2011, 01:22 PM »
just been buried in other stuff but i plan to have a long session with it this weekend and i will report what i find.

phitsc

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 1,198
    • View Profile
    • Donate to Member
Re: FScript2, a new way to build javascript plugins for FARR
« Reply #23 on: January 17, 2011, 01:59 PM »
Tried it with GooglePlus, the only fscript-based plugin I have currently installed.

I first get a message box telling me: "Impossible to create in Plugins/FScript2/proxy"
and after that another one with: "Impossible to copy some GooglePlus.fscript.dll in Plugins/FScript2/proxy"

They are being shown alternately, endlessly, i.e. I need to kill FARR to stop it. After restarting FARR, they were being shown once each and then FARR seemed to run ok. GooglePlus obviously didn't work though.

I understand that you know about this issue. But I think you and mouser should try to find a way to solve this problem so that FScript2 works without the user having to make any changes on filesystem security settings.

I'm running Windows 7 with the default security settings.

ecaradec

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 410
    • View Profile
    • Blog & Projects
    • Read more about this member.
    • Donate to Member
Re: FScript2, a new way to build javascript plugins for FARR
« Reply #24 on: January 20, 2011, 06:19 AM »
Thanks for trying it.  My little hack seems to show it limits. I've been talking with mouser about the possibility of an api to solve the plugin cohosting issue.
I could add an ignore button to avoid the infinite message loop but you'd end up with a non functionning plugin anyway.
Having played with it, I really think it would be great. It feels very good to create a plugin with a single js and see farr recognize it as a native plugin.
Blog & Projects : Blog | Qatapult | SwiffOut | FScript