Custom component not working after the version upgrade

I have an app where i am using a custom component to generate PDFs from RichTextEditor. I was working perfectly when i was on version @2.103.7 But after upgrading to version @3.28.4 it doesn't work anymore. I'm unable to open it in a new window and download it. What is the issue and how can i resolve this ?

Here screenshot of my custom component:

and here is the Iframe code :

   <link rel="preconnect" href="">
   <link rel="preconnect" href="" crossorigin>
   <!-- put any fonts you need here -->

      <!-- here is where you'll need to style your html for printing, especially if you're also displaying it natively inside of your retool app

   <script src="" crossorigin></script>
   <script src="" crossorigin></script>
   <!-- get the HTML to PDF bundle -->
   <script src=""></script>

      // subscribe to model changes
      window.Retool.subscribe(function (model) {
         if (!model) { return }
         var content = model.content;
         // move our printed content into an element we can access later
         document.getElementById("templateContents").innerHTML = content;

      function pdprint() {
         // our function to generate and display the pdf in a new window
         var opt = {
            margin: 0.5,
            filename: 'myfile.pdf',
            image: { type: 'jpeg', quality: 0.98 },
            html2canvas: { scale: 2 },
            jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' }

            .then(function (pdfas) { });

   <!-- now, you just need a button to trigger the printing (you must take an action to open the new window) -->
   <button id="pdfDownloadLink" href="" onclick="pdprint(); return false">Download PDF</button>
   <!-- ... and a place to put our html conten -->
   <div id="templateContents" style="display:none"></div>

Hey @Reshad_Sadik! I believe you need to set an environment variable, ALLOW_SAME_ORIGIN_OPTION. We have a call out in the changelog for 3.22.3 when it was introduced, but it can be easy to overlook.