Sha256: 1bb4b907cf7bd677ceba71233b945c4e3bd5027c3dd39959ff871120f09659ab

Contents?: true

Size: 1.02 KB

Versions: 70

Compression:

Stored size: 1.02 KB

Contents

<%= render_template("lib/json2.min.js") %>
<%= render_template("lib/log.js"); %>
<%= render_template("lib/on_alert.js"); %>

UIATarget.onAlert = function (alert) {
    Log.output({"output":"on alert"});
    var target = UIATarget.localTarget();
    target.pushTimeout(10);
    function dismissPrivacyAlert(retry_count) {
        retry_count = retry_count || 0;
        if (retry_count >= 5) {
            Log.output("Maxed out retry (5) - unable to dismiss privacy alert.");
            return;
        }
        try {
            var answer = isPrivacyAlert(alert);
            if (answer) {
                alert.buttons()[answer].tap();
            }
        }
        catch (e) {
            Log.output("Exception while trying to touch alert. Retrying...");
            if (e && typeof e.toString == 'function') {
                Log.output(e.toString());
            }
            target.delay(1);
            dismissPrivacyAlert(retry_count + 1);
        }
    }

    dismissPrivacyAlert(0);
    target.popTimeout();
    return true;
};

Version data entries

70 entries across 70 versions & 2 rubygems

Version Path
run_loop-4.2.3 scripts/run_loop_basic.js
run_loop-4.2.2 scripts/run_loop_basic.js
run_loop-4.2.1 scripts/run_loop_basic.js
run_loop-4.2.0 scripts/run_loop_basic.js
run_loop-4.1.0 scripts/run_loop_basic.js
run_loop-4.0.0 scripts/run_loop_basic.js
run_loop-3.0.1 scripts/run_loop_basic.js
run_loop-3.0.0 scripts/run_loop_basic.js
run_loop-2.7.1 scripts/run_loop_basic.js
run_loop-2.7.0 scripts/run_loop_basic.js
run_loop-2.6.6 scripts/run_loop_basic.js
run_loop-2.6.5 scripts/run_loop_basic.js
run_loop-2.6.4 scripts/run_loop_basic.js
run_loop-2.6.3 scripts/run_loop_basic.js
run_loop-2.6.2 scripts/run_loop_basic.js
run_loop-2.6.1 scripts/run_loop_basic.js
run_loop-2.6.0 scripts/run_loop_basic.js
run_loop-2.5.4 scripts/run_loop_basic.js
run_loop-2.5.3 scripts/run_loop_basic.js
run_loop-2.5.2 scripts/run_loop_basic.js