aboutsummaryrefslogtreecommitdiff
path: root/simpleSigning/src/main/resources/js/pdfas.js
diff options
context:
space:
mode:
Diffstat (limited to 'simpleSigning/src/main/resources/js/pdfas.js')
-rw-r--r--simpleSigning/src/main/resources/js/pdfas.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/simpleSigning/src/main/resources/js/pdfas.js b/simpleSigning/src/main/resources/js/pdfas.js
index d058bec..1017fee 100644
--- a/simpleSigning/src/main/resources/js/pdfas.js
+++ b/simpleSigning/src/main/resources/js/pdfas.js
@@ -301,6 +301,27 @@ var jqueryRegistration = function() {
//window.addEventListener("message", pdfAs.messageHandler, false);
};
+/**
+ * Protect window.console method calls, e.g. console is not defined on IE
+ * unless dev tools are open, and IE doesn't define console.debug
+ */
+(function() {
+ if (!window.console) {
+ window.console = {};
+ }
+ // union of Chrome, FF, IE, and Safari console methods
+ var m = [
+ "log", "info", "warn", "error", "debug", "trace", "dir", "group",
+ "groupCollapsed", "groupEnd", "time", "timeEnd", "profile", "profileEnd",
+ "dirxml", "assert", "count", "markTimeline", "timeStamp", "clear"
+ ];
+ // define undefined methods as noops to prevent errors
+ for (var i = 0; i < m.length; i++) {
+ if (!window.console[m[i]]) {
+ window.console[m[i]] = function() {};
+ }
+ }
+})();
jqueryRegistration();