Me too I had a similar problem. Loading my web page into an iframe on another website I was getting this error:
Refused to display 'https://mywebsite.com' in a frame because it set 'X-Frame-Options' to 'sameorigin'.
I've solved using this web component that allow an IFrame to bypass the X-Frame-Options: deny/sameorigin response header.
https://github.com/niutech/x-frame-bypass
To test it, just save this code in an index.html file and place in the same directory the file x-frame-bypass.js that you can download from the above Github repository.
Since Safari doesn't support Customized built-in elements, I've added an extra script that allow the support.
https://www.chromestatus.com/feature/4670146924773376
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>X-Frame-Bypass For Global CI calendar</title>
<style>
html, body {
margin: 0;
padding: 0;
height: 100%;
overflow: hidden;
}
iframe {
display: block;
width: calc(100% - 40px);
height: calc(100% - 40px);
margin: 20px;
border: 0;
}
</style>
<!-- To bypass the CROSS ORIGIN Resource issue -->
<script src="x-frame-bypass.js" type="module"></script>
<!-- Support Customized built-in elements for Safari-->
<script src="https://unpkg.com/@ungap/custom-elements-builtin"></script>
</head>
<body>
<iframe is="x-frame-bypass" src="https://www.link_to_any_website.com"></iframe>
</body>
</html>