[Jsprintsetup] Security Idea

Dimitar Angelov mitko at edabg.com
Mon Feb 21 13:00:37 PST 2011


I have omit to show sample code for developer control over permissions:

<script>

var jsPrintSetupCallbackObject = {
	permissionsCheck: function(enabled) {
		alert('permissionsCheck:'+(enabled?'enabled':'disabled'));
	},
	permissionsAsk: function(allowed) {
		alert('permissionsAsk:'+(allowed?'allowed':'blocked'));
	}
}

function print_frame_js()
{
	// Alternate method to set callback function
//	jsPrintSetup.setCallback(jsPrintSetupCallbackObject);
	var perm = jsPrintSetup.getPermissions();
	if (perm == jsPrintSetup.JSPS_DENY_ACTION) {
		// if you don't want to set callback pass null
		jsPrintSetup.askUserPermissions(jsPrintSetupCallbackObject);
	}
	jsPrintSetup.setGlobalOption("DEBUG", 1);
	this.alert(jsPrintSetup.getPrinter());
}
</script>


More information about the Jsprintsetup mailing list