Call Imacros from JS Under FireFox

Discussions and Tech Support specific to the iMacros Firefox add-on.
Forum rules
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team

Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
COSMOS
Posts: 20
Joined: Thu Jul 28, 2016 5:11 am

Re: Call Imacros from JS Under FireFox

Post by COSMOS » Fri Dec 09, 2016 3:17 pm

Thank you for replying so quickly :)
At least now there is some hope.

Sorry about the CIM.
I'm running W7 64bit SP1, FF49.0.2, IMacros for FF 9.0.3

I've tried running your code but it doesn't work. I think I'm missing some information.
How are you running your code? You just paste it in the browser and hit enter ?
Or is there some other special magic ?

This is something I wrote to test it

VERSION BUILD=9030808 RECORDER=FX
TAB T=1
URL GOTO=www.google.com/

Base64 encoded: VkVSU0lPTiBCVUlMRD05MDMwODA4IFJFQ09SREVSPUZYDQpUQUIgVD0xDQpVUkwgR09UTz13d3cuZ29vZ2xlLmNvbS8=
So the link is: imacros://run/?code=VkVSU0lPTiBCVUlMRD05MDMwODA4IFJFQ09SREVSPUZYDQpUQUIgVD0xDQpVUkwgR09UTz13d3cuZ29vZ2xlLmNvbS8=

Not working :(
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Call Imacros from JS Under FireFox

Post by chivracq » Fri Dec 09, 2016 3:59 pm

COSMOS wrote:Thank you for replying so quickly :)
At least now there is some hope.

Sorry about the CIM.
I'm running

Code: Select all

W7 64bit SP1, 
FF49.0.2, 
IMacros for FF 9.0.3
I've tried running your code but it doesn't work. I think I'm missing some information.
How are you running your code? You just paste it in the browser and hit enter ?
Or is there some other special magic ?

This is something I wrote to test it

Code: Select all

VERSION BUILD=9030808 RECORDER=FX
TAB T=1
URL GOTO=www.google.com/
Base64 encoded:

Code: Select all

VkVSU0lPTiBCVUlMRD05MDMwODA4IFJFQ09SREVSPUZYDQpUQUIgVD0xDQpVUkwgR09UTz13d3cuZ29vZ2xlLmNvbS8=
So the link is: imacros://run/?code=VkVSU0lPTiBCVUlMRD05MDMwODA4IFJFQ09SREVSPUZYDQpUQUIgVD0xDQpVUkwgR09UTz13d3cuZ29vZ2xlLmNvbS8=

Not working :(
Hum, works fine for me, you simply click on the Link I included and you should get some Popup saying:
iMacros warning
You are about to run an embedded macro file from forum.imacros.net.
Do you want to run the macro?
[] Always perform the chosen action for the code from forum.imacros.net
[Allow] [Block] [Inspect source code]
Your Link works fine for me as well.
I tested as well in iMacros for FF v8.9.7 + FF47 + Win10-x64 and both Links/Embedded Macros work fine for me.

You are using v9.0.3 which is known for being pretty buggy and to break a lot of Functionality, more stable is v8.9.7, maybe that's one more Functionality broken by v9.0.3...!?
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
COSMOS
Posts: 20
Joined: Thu Jul 28, 2016 5:11 am

Re: Call Imacros from JS Under FireFox

Post by COSMOS » Mon Dec 12, 2016 7:25 am

I tested with imacros for FF v8.9.7, FF47 and W7-x64 and it still doesn't work.

If I click the link on the forum here I get:

"The address wasn't understood
Firefox doesn't know how to open this address, because one of the following protocols (imacros) isn't associated with any program or is not allowed in this context.
You might need to install other software to open this address."

If I copy the link and paste it in the browser and search it does a google search that doesn't find anything:

https://www.google.ro/search?q=imacros: ... GOU7mViJAE

Could it be the OS ? or am I doing something wrong here? Maybe I need to click on something in the browser options tab ?

What I'm trying to do here is to use this command to run some iMacros I have written in JS from a web app I'm building in ASP.NET, that will run on a server and multiple clients can access it.
I don't know if this solution can handle this problem. If it's not what I need I'm considering buying iMacros but I don't really know if I can do this with the enterprise edition or do I need the web.components version ?

Thank you !
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Call Imacros from JS Under FireFox

Post by chivracq » Tue Dec 13, 2016 7:12 pm

COSMOS wrote:I tested with imacros for FF v8.9.7, FF47 and W7-x64 and it still doesn't work.

If I click the link on the forum here I get:

"The address wasn't understood
Firefox doesn't know how to open this address, because one of the following protocols (imacros) isn't associated with any program or is not allowed in this context.
You might need to install other software to open this address."

If I copy the link and paste it in the browser and search it does a google search that doesn't find anything:

Code: Select all

https://www.google.ro/search?q=imacros://run/%3Fcode%3DVkVSU0lPTiBCVUlMRD05MDMwODA4IFJFQ09SREVSPUZYDQpUQUIgVD0xDQpVUkwgR09UTz13d3cuZ29vZ2xlLmNvbS8%3D&ie=utf-8&oe=utf-8&client=firefox-b-ab&gws_rd=cr&ei=v09OWNWWIoGOU7mViJAE
Could it be the OS ? or am I doing something wrong here? Maybe I need to click on something in the browser options tab ?

What I'm trying to do here is to use this command to run some iMacros I have written in JS from a web app I'm building in ASP.NET, that will run on a server and multiple clients can access it.
I don't know if this solution can handle this problem. If it's not what I need I'm considering buying iMacros but I don't really know if I can do this with the enterprise edition or do I need the web.components version ?

Thank you !
No-no, won't be the OS, it's the Browser that doesn't know the 'imacros' Protocol which needs to be registered once with 'navigator.registerProtocolHandler()', I would think that this happens "automatically" from the first time you run any Macro, as I never did anything "special" to get it to work...
It is possible to register it "manually" like for this Example I have for 'mailto' to get associated with 'Gmail':

Code: Select all

javascript:window.navigator.registerProtocolHandler(“mailto”,”https://
mail.google.com/mail/?extsrc=mailto&url=%s”,”Gmail”)
I expected btw to find some 'imacros' Protocol listed on the 'Applications' Tab in the FF or PM Preferences, but nope...!
And I don't know the exact Syntax/URL to use for 'imacros' but stg you can try is to first run this simple Macro:

Code: Select all

VERSION BUILD=8820413 RECORDER=FX
TAB T=1
SET !ERRORIGNORE YES
WAIT SECONDS=3
URL GOTO=imacros://run/?m=#Current.iim
... and then check if after that clicking on a Link runs the embedded Macro.
(I will have stg else to try after if that still doesn't help...)
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
COSMOS
Posts: 20
Joined: Thu Jul 28, 2016 5:11 am

Re: Call Imacros from JS Under FireFox

Post by COSMOS » Wed Dec 14, 2016 8:12 am

I followed that example to the letter but nothing is happening.

javascript:window.navigator.registerProtocolHandler(“mailto”,”https://
mail.google.com/mail/?extsrc=mailto&url=%s”,”Gmail”)

This doesn't do anything. Something should have showed up in my gmail page.

I googled for some other solutions for this problem and found this:

-clear cache and cookies
-go to about:config -> network.protocol-handler.external.javascript and make sure it is set to false (mine was already false)
-restart browser

When I ran that macro you gave me, it shows the same error: The address wasn't understood.
If you have any other tips, I'm glad to listen.

In order to solve my problem ( which is running imacros code from an ASP.NET web app because I want to supply a list of data processed from an SQL database, which imacros should search on different websites and return useful data), I have 2 options at the moment:
-either encode my macros and play them with that link
-or use the web.components to embed it in my app

(I have played around with the web components trial version.
I made a post in the .NET area: http://forum.imacros.net/viewtopic.php?f=24&t=27018
That might be a solution to my problem, but I can't make it work for web form.)

-is there any other way ? If I buy enterprise edition will it help me with this problem ? or do I need the web components ?

Thank you !
Post Reply