Skip to content

Instantly share code, notes, and snippets.

@DigiTec
Created March 11, 2013 01:51
Show Gist options
  • Save DigiTec/5131407 to your computer and use it in GitHub Desktop.
Save DigiTec/5131407 to your computer and use it in GitHub Desktop.
Add a privacy policy to your Windows 8 based WWA. Note, all of the samples utilized WinJS and I needed a non WinJS version. I don't claim in any way this is novel, but it took me nearly an hour to pull this together since there were no fully baked samples.
var settingsPane = Windows.UI.ApplicationSettings.SettingsPane.getForCurrentView();
settingsPane.addEventListener("commandsrequested", foo);
function foo(args) {
var cmdPrivacy = new Windows.UI.ApplicationSettings.SettingsCommand("privacy", "Privacy Policy", privacyPolicyInvoked);
args.request.applicationCommands.push(cmdPrivacy);
}
function privacyPolicyInvoked(args) {
switch (args.id) {
case "privacy":
window.open("http://www.freeprivacypolicy.org/generic.php", "_blank");
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment