Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to redirect to ios settings in Safari use javascript in ios9

I want to know how to redirect to the iOS settings from Safari.

I've seen this on one website: I opened this website in Safari, and there is a button, and when I click this button, it can redirect to the iOS settings.

I think this can be realized by javascript.

Does anyone knows how to do this?

Note: I am using iOS9.

like image 910
Song Yongtao Avatar asked Dec 27 '25 18:12

Song Yongtao


1 Answers

Sorry,I have to answer my own question.I've found the solution.Just tested in ios9

This is my code:

<input type="button" onclick="redirect()" value="Redirect">
<script>
    var redirect = function() {
        window.location.href = "prefs:root=Settings";
    }
</script>

When I open this page in Safari and click the button,it can redirect to the Settings

If I want to redirect to Settings->General,it should be:

window.location.href = "prefs:root=General";

If I want to redirect to the Settings->General->Profiles,then should be:

window.location.href = "prefs:root=General&path=ManagedConfigurationList";

And I found the Preference list http://iphonedevwiki.net/index.php/Preferences.app

like image 147
Song Yongtao Avatar answered Dec 30 '25 09:12

Song Yongtao



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!