CanvasBlocker/test/dataUrlTest.js

16 lines
445 B
JavaScript
Raw Normal View History

(function(){
"use strict";
2019-12-16 19:27:28 +01:00
const iframeCode = atob(
document.getElementById("iframe").src.replace(/^.+base64,/, "")
);
document.getElementById("code").textContent = iframeCode;
2020-01-06 14:55:11 +01:00
const blob = new Blob([iframeCode.replace(
"const origin = \"data URL iframe\";",
"const origin = \"blob iframe\";"
)], {type: "text/html"});
2019-12-16 19:27:28 +01:00
const newurl = window.URL.createObjectURL(blob);
document.getElementById("blobIframe").src = newurl;
}());