Create a data-display page that can accept MessageEvents containing the data you want to display:
<html>
<head>
<script>
window.addEventListener("message", function(event) {
/* for security, check event.origin here and
return if not a safe/recognized URL */
console.log(event.data); // prints message as string
/* dynamically display data on page here */
}, false);
</scrip>
</head>
<body>
<!-- put HTML template for display of data here -->
</body>
</html>
Then in your bookmarklet, open the data-display page in a new window and send it the data using postMessage:
<!-- bookmarking this link creates the bookmarklet -->
<a href='javascript:(function() {
var dataWin = window.open("dataDisplayPageUrl.html", "dataWin");
dataWin.postMessage(dataLayer, "https://mywebsite.com");
})();'>bookmark this</a>
EDIT: Apparently more complicated in IE: Is cross-origin postMessage broken in IE10?
EDIT 2: Testing this in Chrome, it appears that there is a small delay between when a new window is opened and when it can receive messages. Adding a delay to the bookmarklet fixes the problem:
<!-- bookmarking this link creates the bookmarklet -->
<a href='javascript:(function() {
var dataWin = window.open("dataDisplayPageUrl.html", "dataWin");
window.setTimeout(function() {
dataWin.postMessage(dataLayer, "https://mywebsite.com");
}, 1000);
})();'>bookmark this</a>