michael@0: jsURL = "javascript:" + escape('window.parent.postMessage("JS uri ran", "*");\ michael@0: return \'\ michael@0: \''); michael@0: dataURL = "data:text/html," + escape('\ michael@0: '); michael@0: michael@0: tests = [ michael@0: // Plain document should work as normal michael@0: '\ michael@0: ', michael@0: michael@0: // refresh to plain doc michael@0: { refresh: "file_bug475636.sjs?1", michael@0: doc: '' }, michael@0: michael@0: // meta-refresh to plain doc michael@0: '\ michael@0:
\ michael@0: \ michael@0: ', michael@0: michael@0: // refresh to data url michael@0: { refresh: dataURL, michael@0: doc: '' }, michael@0: michael@0: // meta-refresh to data url michael@0: '\ michael@0: \ michael@0: \ michael@0: ', michael@0: michael@0: // refresh to js url should not be followed michael@0: { refresh: jsURL, michael@0: doc: michael@0: '\ michael@0: ' }, michael@0: michael@0: // meta refresh to js url should not be followed michael@0: '\ michael@0: \ michael@0: \ michael@0: \ michael@0: ' michael@0: ]; michael@0: michael@0: michael@0: function handleRequest(request, response) michael@0: { michael@0: dump("@@@@@@@@@hi there: " + request.queryString + "\n"); michael@0: test = tests[parseInt(request.queryString, 10) - 1]; michael@0: response.setHeader("Content-Type", "text/html"); michael@0: michael@0: if (!test) { michael@0: response.write(''); michael@0: } michael@0: else if (typeof test == "string") { michael@0: response.write(test); michael@0: } michael@0: else if (test.refresh) { michael@0: response.setHeader("Refresh", "0; url=" + test.refresh); michael@0: response.write(test.doc); michael@0: } michael@0: }