michael@0: /** michael@0: * Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/publicdomain/zero/1.0/ michael@0: */ michael@0: "use strict"; michael@0: michael@0: var customHeader = "custom-key"; michael@0: var customHeaderValue = "custom-key-value"; michael@0: michael@0: self.onmessage = function(event) { michael@0: var xhr = new XMLHttpRequest(); michael@0: xhr.open("GET", event.data, false); michael@0: xhr.setRequestHeader(customHeader, customHeaderValue); michael@0: xhr.send(); michael@0: postMessage({ response: xhr.responseText, header: customHeader }); michael@0: }