mirror of
https://github.com/plausible/analytics.git
synced 2024-12-23 17:44:43 +03:00
7d37208d52
* Allow custom styles to be passed to embedded iframe * Changelog
17 lines
351 B
JavaScript
17 lines
351 B
JavaScript
import 'iframe-resizer/js/iframeResizer.contentWindow'
|
|
|
|
window.iFrameResizer = {
|
|
onMessage: function(msg) {
|
|
if (msg.type === 'load-custom-styles') {
|
|
addCustomStyles(msg.opts)
|
|
}
|
|
}
|
|
}
|
|
|
|
function addCustomStyles(opts) {
|
|
var style = document.createElement('style');
|
|
style.innerHTML = opts.styles
|
|
|
|
document.head.appendChild(style);
|
|
}
|