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.9.1 scripts/run_loop_basic.js
run_loop-4.9.0 scripts/run_loop_basic.js
run_loop-4.8.1 scripts/run_loop_basic.js
run_loop-4.8.0 scripts/run_loop_basic.js
run_loop-4.7.0 scripts/run_loop_basic.js
run_loop-4.6.3 scripts/run_loop_basic.js
run_loop-4.6.1 scripts/run_loop_basic.js
run_loop-4.6.0 scripts/run_loop_basic.js
run_loop-4.5.7 scripts/run_loop_basic.js
run_loop-4.5.6 scripts/run_loop_basic.js
run_loop-4.5.5 scripts/run_loop_basic.js
run_loop-4.5.4 scripts/run_loop_basic.js
run_loop-4.5.3 scripts/run_loop_basic.js
run_loop-4.5.2 scripts/run_loop_basic.js
run_loop-4.5.1 scripts/run_loop_basic.js
run_loop-4.5.0 scripts/run_loop_basic.js
run_loop-4.4.2 scripts/run_loop_basic.js
run_loop-4.4.1 scripts/run_loop_basic.js
run_loop-2.3.2 scripts/run_loop_basic.js
run_loop-4.3.0 scripts/run_loop_basic.js