Getting a blank page when navigating between GAS web pages - google-apps-script

I am building a multipage web app using GAS.
The actual URLs for the pages of my app are generated by my GAS and passed via the data variable to my html template.
A scriptlet is inserting the URL into the html template:
<a href="<?= data.urlVUS ?>" >User</a>
The problem is: The first time I click on the link the page is loaded. The second or third time I click the link I see just a blank browser page.
There is no error in my GAS log or in the browser that indicates what is wrong.
My GAS is using
return myPage.evaluate().setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL);
I am not sure if it is contributing to the problem, but I am embedding the web app via an iframe within a Wordpress page.

Related

src in html not allowed to load a local resource

I am doing a project, where I need to show an image on html page. The image is located in a network drive. Using the below tag to refer to the image, I receive a "Not allowed to load local resource:" error.
<img src="file://sc19/dept0213/SSC_Data/SVD/SVD%20Robot%20Experiment/4b9262caa1b64079ad8b31c3a3662598_1/Measurement/bot_Images/4.png" alt="Image">
If I however, open a new tab in the same Edge web browser, and copy the file://sc19/dept0213/SSC_Data/SVD/SVD%20Robot%20Experiment/4b9262caa1b64079ad8b31c3a3662598_1/Measurement/bot_Images/4.png into the address bar, the image is displayed inside the web browser. I have tried with Google Chrome in stead of Microsoft Edge and turned off the security feature, but still get the same error.
Additional information.
The HTML page was rendered using Django as backend. In my Django template I have.
<img src="file://sc19/dept0213/SSC_Data/SVD/SVD%20Robot%20Experiment/4b9262caa1b64079ad8b31c3a3662598_1/Measurement/bot_Images/4.png" alt="Image">
Could an alternative approach be that the front end is doing a request to the backend that then fetches the image, and put it somewhere that can be reached from front end?
For my project, the solution I ended up using was for my frontend to send a request to the backend. The backend then fetches the image, and send it as a blob to the frontend. I know that setting up a webserver is another possibility, but in this case my Django backend already acts as a webserver.

Is it possible to create dynamic routes in Next Js that can be embedded in external websites using iframes?

I have a Next JS app, where admin users create and manage schedules for their businesses. I want to create a robust way for users to be able to embed a public url from the next js admin app in any external website for their businesses that they might have(eg a wordpress landing page), which displays their specific schedule( A next page that can have any functionality) in their respective landing pages.
I have tried to just link any of my next routes in an external html page using
<iframe src="next app route"></iframe>
I would expect to see that page displayed within the iframe( as it would have looked if I had accessed the url in the browser, but within the constraints of the iframe), but the page doesn't display within the iframe, and I get a blank space. But the same iframe works with a simple ".html" page url that I found randomly.
This related thread suggests that CRA is more suited for this. But I don't really understand how. Especially because each user in my next app, will have a different page that needs to be embedded!

view html source while using CSR with React

I'm studying ways to develop a SEO-friendly React website with CSR.
I have read many articles pointing out that to provide a SEO-friendly website, one should go with the SSR approach.
To my knowledge, when using browser's view source feature in CSR, the html content is a bunch of javascript bundle files and the actual html would not be present since view source only shows what's rendered from server side. while in SSR html is rendered and passed to the browser and the displayed html would be present in source view of the page.
However https://divar.ir (a well known retailer site) seems to be using CSR (upon clicking any link, the data is fetched from an api endpoint in json format via an ajax call and then it looks like the page is rendered in client side).
The thing is, when I view the source of the page even after clicking any link, I can see the actual html that is being displayed.
So to sum it up, How can I use CSR in React, and when I view the source of a page, I actually see the html that is being displayed to the user?
Server side rendered react applications usually only pre-render the initial page load. Subsequent navigation may still be entirely handled and rendered by the client.
By using the view source tool it will open the code in a new tab (at least in chrome) that leads to a fresh load of the current route from the server. If the application is server side rendered you will receive a pre-rendered version of that route and therefore see the html for that route.
By providing a sitemap of your website a bot can discover all SEO relevant routes by visiting the urls provided in the sitemap. Each of those requests are independent requests to the server and will be pre-rendered in contrast to how a real user would navigate the page by clicking the links.

How did gdprscript.js get into the header of my Weebly site?

When I view the source of my website, I am seeing this script inserted into my website. However I cannot find the template where it is being added.
This javascript html tag is inserted automatically by Weebly's backend server itself. It inserts it immediatly after the <head> element and before any items you have defined in your actual template file.
<script src="/gdpr/gdprscript.js?buildTime=1558379751&hasRemindMe=true&stealth=false"></script>
What does it do?
This code forces the display of the "This site uses cookies..." message that pops over the bottom part of the page. It also handles the user's selection.
Why is it inserted if my site does not use cookies?
It is inserted because Weebly itself forces your site to use cookies. It does this to enable its own collection of analytics on your homepage.
Does it slow down my site
Yes. Code like this should be inserted after the site content.
Can it be removed?
You may be able have this removed by contacting Weebly directly.

How to embed local HTML file to existing GWT page

I have a page that is constructed by GWT, when the page get loaded, I will display some required content in it. And then if user click a certain button on the page, I will send request to server side and server will return me a HTML file(a chart generated by jquery plotting tool) stored in local directory, I need to display this HTML file into the existing GWT page's certain widget.
I tried to use Frame in GWT to link to the local HTML file and display it, it get failed, googled and found it's because of browser security setting.Please share your thought, any idea is appreciated.