function workerBoilerScript() {

	var postMessage = self.postMessage;
	var structuredCloningSupport = null;

	self.console = {};
	self.isWorker = true;

	// Provide basic console interface:
	['log', 'debug', 'error', 'info', 'warn', 'time', 'timeEnd'].forEach(function(meth) {
		self.console[meth] = function() {
			postMessage({
				cmd: 'console',
				method: meth,
				args: [].slice.call(arguments)
			});
		};
	});

	self.addEventListener('message', function(e) {

		var data = e.data;

		if (typeof data == 'string' && data.indexOf('EVAL|') === 0) {
			eval(data.substring(5));
			return;
		}

		if (structuredCloningSupport == null) {

			// e.data of ['PING'] (An array) indicates transferrableObjSupport
			// e.data of '"PING"' (A string) indicates no support (Array has been serialized)
			structuredCloningSupport = e.data[0] === 'PING';

			// Pingback to parent page:
			self.postMessage(
				structuredCloningSupport ?
					'pingback:structuredCloningSupport=YES' :
					'pingback:structuredCloningSupport=NO'
			);

			if (!structuredCloningSupport) {
				postMessage = function(msg) {
					// Marshal before sending
					return self.postMessage(JSON.stringify(msg));
				};
			}

			return;
		}

		if (!structuredCloningSupport) {
			// Demarshal:
			data = JSON.parse(data);
		}

		var defs = data.definitions;
		var isDeferred = false;
		var isAsync = false;
		var args = data.args;

		if (defs) {
			// Initial definitions:
			for (var i in defs) {
				self[i] = defs[i];
			}
			return;
		}

		args.push(function() {
			// Callback function to be passed to operative method
			returnResult({
				args: [].slice.call(arguments)
			});
		});

		self.async = function() { // Async deprecated as of 0.2.0
			isAsync = true;
			return function() { returnResult({ args: [].slice.call(arguments) }); };
		};

		self.deferred = function() {
			isDeferred = true;
			var def = {};
			function fulfill(r) {
				returnResult({
					isDeferred: true,
					action: 'fulfill',
					args: [r]
				});
				return def;
			}
			function reject(r) {
				returnResult({
					isDeferred: true,
					action: 'reject',
					args: [r]
				});
			}
			def.fulfil = def.fulfill = fulfill;
			def.reject = reject;
			return def;
		};

		// Call actual operative method:
		var result = self[data.method].apply(self, args);

		if (!isDeferred && !isAsync && result !== void 0) {
			// Deprecated direct-returning as of 0.2.0
			returnResult({
				args: [result]
			});
		}

		self.deferred = function() {
			throw new Error('Operative: deferred() called at odd time');
		};

		self.async = function() { // Async deprecated as of 0.2.0
			throw new Error('Operative: async() called at odd time');
		};

		function returnResult(res) {
			postMessage({
				cmd: 'result',
				token: data.token,
				result: res
			});
			// Override with error-thrower if we've already returned:
			returnResult = function() {
				throw new Error('Operative: You have already returned.');
			};
		}
	});
}
/**
 * The boilerplate for the Worker Blob
 * NOTE:
 *  this'll be executed within an iframe, not here.
 *  Indented @ Zero to make nicer debug code within worker
 */
The boilerplate for the Worker Blob
NOTE:
this'll be executed within an iframe, not here.
Indented @ Zero to make nicer debug code within worker
The boilerplate for the Worker Blob NOTE : this ' ll be executed within an iframe not here . Indented @ Zero to make nicer debug code within worker
function workerBoilerScript() {
	var postMessage = self.postMessage;
	var structuredCloningSupport = null;
	self.console = {};
	self.isWorker = true;
	['log', 'debug', 'error', 'info', 'warn', 'time', 'timeEnd'].forEach(function(meth) {
		self.console[meth] = function() {
			postMessage({
				cmd: 'console',
				method: meth,
				args: [].slice.call(arguments)
			});
		};
	});
	self.addEventListener('message', function(e) {
		var data = e.data;
		if (typeof data == 'string' && data.indexOf('EVAL|') === 0) {
			eval(data.substring(5));
			return;
		}
		if (structuredCloningSupport == null) {
			structuredCloningSupport = e.data[0] === 'PING';
			self.postMessage(
				structuredCloningSupport ?
					'pingback:structuredCloningSupport=YES' :
					'pingback:structuredCloningSupport=NO'
			);
			if (!structuredCloningSupport) {
				postMessage = function(msg) {
					return self.postMessage(JSON.stringify(msg));
				};
			}
			return;
		}
		if (!structuredCloningSupport) {
			data = JSON.parse(data);
		}
		var defs = data.definitions;
		var isDeferred = false;
		var isAsync = false;
		var args = data.args;
		if (defs) {
			for (var i in defs) {
				self[i] = defs[i];
			}
			return;
		}
		args.push(function() {
			returnResult({
				args: [].slice.call(arguments)
			});
		});
		self.async = function() { 
			isAsync = true;
			return function() { returnResult({ args: [].slice.call(arguments) }); };
		};
		self.deferred = function() {
			isDeferred = true;
			var def = {};
			function fulfill(r) {
				returnResult({
					isDeferred: true,
					action: 'fulfill',
					args: [r]
				});
				return def;
			}
			function reject(r) {
				returnResult({
					isDeferred: true,
					action: 'reject',
					args: [r]
				});
			}
			def.fulfil = def.fulfill = fulfill;
			def.reject = reject;
			return def;
		};
		var result = self[data.method].apply(self, args);
		if (!isDeferred && !isAsync && result !== void 0) {
			returnResult({
				args: [result]
			});
		}
		self.deferred = function() {
			throw new Error('Operative: deferred() called at odd time');
		};
		self.async = function() { 
			throw new Error('Operative: async() called at odd time');
		};
		function returnResult(res) {
			postMessage({
				cmd: 'result',
				token: data.token,
				result: res
			});
			returnResult = function() {
				throw new Error('Operative: You have already returned.');
			};
		}
	});
}
function workerBoilerScript ( ) { var postMessage = self . postMessage ; var structuredCloningSupport = null ; self . console = { } ; self . isWorker = true ; [ 'log' , 'debug' , 'error' , 'info' , 'warn' , 'time' , 'timeEnd' ] . forEach ( function ( meth ) { self . console [ meth ] = function ( ) { postMessage ( { cmd : 'console' , method : meth , args : [ ] . slice . call ( arguments ) } ) ; } ; } ) ; self . addEventListener ( 'message' , function ( e ) { var data = e . data ; if ( typeof data == 'string' && data . indexOf ( 'EVAL|' ) === 0 ) { eval ( data . substring ( 5 ) ) ; return ; } if ( structuredCloningSupport == null ) { structuredCloningSupport = e . data [ 0 ] === 'PING' ; self . postMessage ( structuredCloningSupport ? 'pingback:structuredCloningSupport=YES' : 'pingback:structuredCloningSupport=NO' ) ; if ( ! structuredCloningSupport ) { postMessage = function ( msg ) { return self . postMessage ( JSON . stringify ( msg ) ) ; } ; } return ; } if ( ! structuredCloningSupport ) { data = JSON . parse ( data ) ; } var defs = data . definitions ; var isDeferred = false ; var isAsync = false ; var args = data . args ; if ( defs ) { for ( var i in defs ) { self [ i ] = defs [ i ] ; } return ; } args . push ( function ( ) { returnResult ( { args : [ ] . slice . call ( arguments ) } ) ; } ) ; self . async = function ( ) { isAsync = true ; return function ( ) { returnResult ( { args : [ ] . slice . call ( arguments ) } ) ; } ; } ; self . deferred = function ( ) { isDeferred = true ; var def = { } ; function fulfill ( r ) { returnResult ( { isDeferred : true , action : 'fulfill' , args : [ r ] } ) ; return def ; } function reject ( r ) { returnResult ( { isDeferred : true , action : 'reject' , args : [ r ] } ) ; } def . fulfil = def . fulfill = fulfill ; def . reject = reject ; return def ; } ; var result = self [ data . method ] . apply ( self , args ) ; if ( ! isDeferred && ! isAsync && result !== void 0 ) { returnResult ( { args : [ result ] } ) ; } self . deferred = function ( ) { throw new Error ( 'Operative: deferred() called at odd time' ) ; } ; self . async = function ( ) { throw new Error ( 'Operative: async() called at odd time' ) ; } ; function returnResult ( res ) { postMessage ( { cmd : 'result' , token : data . token , result : res } ) ; returnResult = function ( ) { throw new Error ( 'Operative: You have already returned.' ) ; } ; } } ) ; }
The boilerplate for the Worker Blob
 NOTE:
  this'll be executed within an iframe, not here.
The boilerplate for the Worker Blob NOTE : this ' ll be executed within an iframe not here .
// Provide basic console interface: // e.data of ['PING'] (An array) indicates transferrableObjSupport // e.data of '"PING"' (A string) indicates no support (Array has been serialized) // Pingback to parent page: // Marshal before sending // Demarshal: // Initial definitions: // Callback function to be passed to operative method // Async deprecated as of 0.2.0 // Call actual operative method: // Deprecated direct-returning as of 0.2.0 // Async deprecated as of 0.2.0 // Override with error-thrower if we've already returned: