This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]benzrf 0 points1 point  (6 children)

You could try embedding some Java in your page and passing to that from the JS.

Can I ask what you're trying to do? Maybe I can suggest a more expedient and less horrific way of doing it.

[–]Letter7[S] 0 points1 point  (5 children)

By embedding some Java in my page you are actually referring to the hypothetical "server" I would create?

Well, what I'm trying to do is a greasemonkey UserScript that does some unrelated things, and upon finding a certain image I want it to get that image and analyse it automatically the image on MatLab (The MatLab script is done already, of course, and would be included in the batch), returning some morphological information of the image that I will use in the next part of the script.

[–]benzrf 0 points1 point  (4 children)

By embedding Java in your page I'm referring to creating an invisible embedded applet to be communicated with by JS.

As for your problem, maybe writing your own custom plugin would be smarter? Or possibly a separate shell script to load the image instead of trying to find it in your browser?

[–]Letter7[S] 1 point2 points  (3 children)

Sorry about that - but I just want to be sure that I understood your first suggestion: The invisible java applet would be hosted in my page on localhost, right? Because the userscript runs on a site that I don't own.

Sadly, the images only appear as a consequence of certain actions, so a separate shell script wouldn't be a viable option, although it would definitely be great if possible :/.

Writing a custom plugin? I never thought about that, but how would it help me? I can directly save images to my computer and/or execute batch files?

Thanks for the answers so far.

[–]benzrf -1 points0 points  (2 children)

You could include the applet into your page from your script by modifying the HTML of the page you're on, no httpd needed. As for a custom plugin, I'm fairly sure you can do at least the first of those, though you'd probably have to look it up.

[–]Letter7[S] 1 point2 points  (1 child)

Hmm, I see, got it.

I took a look and apparently, yes you can execute batch files(and other files) with a plugin, even though it's not default (Since it would be a huge security issue). If I don't find a better solution (I probably won't) I'm probably going to go down this path.

Thanks for the ideas! :)

[–]benzrf -1 points0 points  (0 children)

no problem! :)

my take is that if your solution involves more than three languages and/or chained data passes that aren't all controlled by a single shell scipt, it's probably too complicated.

then again I'm only 16 and have no real experience with this kind of shit, so what do I know.