-1

I need help in creating script to define a block DIV .

There is a service in which you sound signal with the appearance of this side

<div class="captcha-flow-row" onmouseout="Anti.dashboard.flowActive = 1;"
     onmouseover="Anti.dashboard.flowActive = 0;" style="">

in the tree of elements this block is always hidden by style="display:none;"

And still need to make a timer to check every 2 seconds ...

P.S. condition of the item before and after the start of the process:

before

after

wOxxOm
  • 65,848
  • 11
  • 132
  • 136
ROGG
  • 1
  • 1
  • 1
    Question is not very clear – Malith Oct 02 '15 at 09:34
  • I need to track the emergence of this block on the screen – ROGG Oct 02 '15 at 09:39
  • Not enough information. Does the GreaseMonkey script create this div, or does it have to check, every 2 seconds, if this div now exists? Also, you seem to have two questions: how to build the script, and why is the div hidden. – Mr Lister Oct 02 '15 at 09:49
  • need sound your horn when this div appears on the page. It would mean that the process of solving the captcha started. – ROGG Oct 02 '15 at 10:05
  • https://www.dropbox.com/s/uqaa6j16wkweywb/%D0%A1%D0%BA%D1%80%D0%B8%D0%BD%D1%88%D0%BE%D1%82%202015-10-02%2013.06.19.png?dl=0 https://www.dropbox.com/s/acq81fmz9p69oqw/%D0%A1%D0%BA%D1%80%D0%B8%D0%BD%D1%88%D0%BE%D1%82%202015-10-02%2013.07.36.png?dl=0 – ROGG Oct 02 '15 at 10:08
  • above two screenshot showing the condition of the item before andafter the start of the process ... That's got to catch the beginning of the process of solving and sound the horn – ROGG Oct 02 '15 at 10:11

1 Answers1

-1

Instead of timers it's possible to detect the change right when it occurs using MutationObserver.

// ==UserScript==
// @name          Detect DIV
// @include       http://somesite/somepath*
// ==/UserScript==

var div = document.querySelector("#captcha_dashboard div.captcha-flow-row");
var ob = new MutationObserver(function(mutations) {
    if (div.style.display != "none") {
        alert('DIV IS VISIBLE');
        ob.disconnect(); // stop monitoring the page
    }
});
ob.observe(div, {attributes: true, attributeFilter: ["style"]});

As for audio beep, it's a complicated task, see the solutions.

Community
  • 1
  • 1
wOxxOm
  • 65,848
  • 11
  • 132
  • 136