5

I'm using javascript and imacros to collect some data from a website and I have this line of code:

final_macro += "ADD !EXTRACT " + '"' + lager_col2[0].textContent + '"' + "\n";

When I ran my js in the browser I got this error:

Error: Accessing content window is not supported in multiprocess Firefox, line 208 (Error code: -991)

Should I be worried ? Is the use of textContent forbidden ? The problem is that lager_col2[0] sometimes happen to be a link and I only want the text inside the link, not the tags and everything. So naturally I went with textContent. How could I get around this ?

Additionally, am I setting myself up for trouble when trying to access certain nodes with the use of window.document.getElementsByClassName? Is it better to use iMACROS TAG POS/XPATH ?

David Makogon
  • 69,407
  • 21
  • 141
  • 189
Cosmos24Magic
  • 219
  • 4
  • 17

5 Answers5

4

The strange thing is I'm getting the exact same error that you are even down to the code line number. Obviously my JavaScript line numbers do not match yours. At first I thought the problems were caused by my recent upgrade to Firefox 48. But when I moved my imacros to another machine that is running Firefox 47 I got the exact same error as you.

Update: My workaround was to downgrade the Firefox iMacros extension from 9.0.3 to 8.9.7. Now my macro is working again with Firefox version 47 and iMacros version 8.9.7.

GuitarViking
  • 165
  • 2
  • 12
  • Indeed you are right. Downgrading does work but as this is going to be a solution I need to give my clients I can't rely on the fact that they will listen to by advice and run an old FF version just to use IMacros :P My solution was to rework all the code and eliminate all the DOM stuff which is not supported anymore in the javascript interface. – Cosmos24Magic Sep 01 '16 at 06:17
  • 1
    I was able to avoid the error with the current Firefox version 48. After trying again, I just had to downgrade iMacros to 8.9.7. – GuitarViking Sep 10 '16 at 06:21
0

In similar cases I can suggest you one of my old workarounds with an additional function in order to get some window content:

var someContent = getSomeContent("document.getElementsByClassName('someclass')[0].textContent");
alert(someContent);

function getSomeContent(selector) {
    var ret = iimPlayCode("URL GOTO=javascript:alert(" + selector + ");");
    if (ret < 0)
        return iimGetErrorText().match(/Dialog message: "([\s\S]*)",/)[1];
}

The idea seems to be helpful. But I haven't yet tested this script in multiprocess Firefox.

Shugar
  • 5,269
  • 1
  • 9
  • 9
0

Reinstall plugin iMacros. It's helped me.

  • Would be good if you could provide a little background -- did you have the exact same error? Is op's code example valid? – mtjhax Aug 12 '16 at 17:29
0

imacro does not support to access dom element please go back to older version of imacro older than imacro 9.

Sanjib Debnath
  • 3,556
  • 2
  • 22
  • 16
0

Firefox > 47.0.1 and iMacros > 8.9.7 not supported (because Firefox architecture changed)

Solve:

STEP 1. Remove add-on imacros if installed.

STEP 2. Uninstall Firefox.

STEP 3. Follow this link for download Firefox version Firefox 47.0.1. https://download-installer.cdn.mozilla.net/pub/firefox/releases/47.0.1/win32/en-US/Firefox%20Setup%2047.0.1.exe or this link https://support.mozilla.org/en-US/kb/install-older-version-of-firefox

STEP 4. Install Firefox 47.0.1 and after launch Firefox visit " about:support " .

STEP 5. You can see button "Refresh Firefox" click it and restart Firefox.

STEP 6. Follow this link to download iMacros version 8.9.7. https://addons.mozilla.org/en-US/firefox/addon/imacros-for-firefox/versions/

Badr Elmers
  • 1,487
  • 14
  • 20
Fortran
  • 2,218
  • 2
  • 27
  • 33