how to open https(X-Frame-Options) website in iframe or any html page - html

I've an app, which loads data from database. In a table I'm storing some URLs EX: https://facebook.com. Remember these URLs are dynamic and are controlled in admin panel.
Now, I need to get contents of these URLs and display it inside iFrame or inside a div within my app. Idea here is user should not go away from my app.
When I tried to load https://facebook.com it never loads because they've (X-Frame-Options) enabled.
Is there any solution for this?

You cannot tell the browser to ignore the security instructions provided by the third party site. That would defeat the object of having them in the first place.
If you want to display the content on your site, then you will have to display it from your own server (e.g. by using a server side process to read the data from the third party site and serve it from your own). Obviously, this will mean that you cannot (for example) load Facebook using the user's own credentials.

Related

Can redirect website/page when site server is down (This Site Can't Be Reached)?

is there any possibility to redirect the website or a page on my site, in case the server crashes (is down) ? I mean, I get sometimes the error "This Site Can't Be Reached", because of my hosting servers, and somehow I want to redirect to another website only when this error appears.
can be done, somehow?
Not directly. You can't send an instruction to the browser to redirect if it can't make a connection to your site in the first place.
You can put another service, with better uptime, in front of your site (e.g. Amazon CloudFront) and have your visitors request from their services instead of directly from yours. Obviously this doesn't work so well if you have personalised content.
CloudFront or another edge-cache would do this for you. It stores a copy of your website in a cache that sits in-front of your website. When it detects your website is unhealthy (i.e. down), it can display some predefined html that you store in e.g. an S3 bucket. In terms of redirecting to another website, you could put a link in that html, but it wouldn't be an automatic 'failover' where if your site is down, another entire web page loads.

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 to Embed an Apex website on my HTML Website

I have an Apex application which I use for CMS of my website, I want to embed this on my website when a user logs in.
I have tried using an iframe however the APEX Application does not show in the iframe.
What is the correct way for embedding an APEX Application inside an HTML website?
In the APEX Application manager there is a setting to allow browser embedding this must be enabled in order to embed in an iframe. I had overlooked this setting when trying it.
As a new user of APEX it was not clear exactly where to find the setting mentioned by the OP. For APEX 5 I found the setting to enable iframes as follows:
Open APEX in your browser (for example, my URL is http://some-host:1337/ords)
Login to your workspace as an administrator
Click on Application Builder
Click the name of the application you want to enable to open it
On the title bar where your application name appears, click on Edit Application Properties (button to the right)
Toward the top, locate the link for Security and click it
Scroll down to the Browser Security section or click on the tab labeled Browser Security
Assuming it says Deny, change it to Allow or Allow from same origin
Press Apply Changes
Once this is complete you should be able to embed a URL for that specific APEX application in the src="[apex_url]" attribute of an iframe.
Note: Choosing Allow vs Allow from same origin depends on whether or not your application is running on the same host / root URL. In my case, the iframe was served from a different URL thus I chose Allow. Out of scope for this question but, for security reasons, you probably need to consider the implications of allowing this in your own environment.

Link to and display an image on an Access 2013 App view

I am using Access 2013 with our enterprise Office 365 Sharepoint site to create a simple Access App. I'm unsure of all the terminology--the main point is that this is an Access App as opposed to a desktop application. I am wondering if there is a way to display an image on a list view, where the image source is a data field. Here's what I can do so far and where I get stuck:
I can add a picture control. I can set the picture to a permanent URL that displays just fine in the view. However, this is a permanent setting for the view of any record.
I can add a URL field to the table. It's easy to pick the URL in datasheet view, and on list view, it's difficult to change the URL, but clicking on it will pop up the image (or whatever link) in a new tab or window.
I can create a Web Browser Control. I can have this control source be the URL frame. When I look at this view using an IE browser, I get something that looks like an iFrame. However, no matter what URL I try, the content will not load.
More clarification here: Depending on whether I try Flickr or an image hosted on my own OneDrive, I get different errors. One of the errors I get (tyring to use my own OneDrive with publicly shared image) is: "To help protect the security of information you enter into this website, the publisher of this content does not allow it to be displayed in a frame."
More information: If I link to a publicly shared image from Google Drive, then the Web Browser Control does in fact show the image. This is not ideal, and I'd rather be able to dynamically change the link for the Picture Control, as opposed to embedding web content.
This is where I am stuck on two avenues. (A) The Web Browser Control will not show any content (maybe this is a security setting of my institution's Sharepoint 2013?). And (B) I cannot figure out how to dynamically change the URL for the picture control. Option B may be possible with a macro, but macros in Access Apps are different than desktop version and much more limited in capability. And I'm not good at either set of macros. Thanks for any ideas!

an iframe for multiple users

I am trying to create a web page with the following :
Buttons and input fields etc. in the top half of the page that allow the user to define certain criteria, when the user clicks submit, the page calls some php code that writes an iframe referenced html file which is then shewn on the bottom part of the web page.
I think I understand how to do this for a web page referring to a single iframe document source but there may be more than one user running the page so how do I have the iframe pointing to the correct iframe source for each user?
Some web searching sugests that this is the kind of thing done with XMLHttpRequest, I'll have a look into that.
If I understand correctly, your PHP code creates an HTML file and then loads it in an iframe.
You could have your PHP script output the HTML, then load the PHP script in your iframe directly. Now there is no way for another user to accidentally get the other users' output.
I'm not sure if I understand exactly what you want to do.. but if you have already existing database of users, make a new table with Iframe preferences... so when they click submit, the preferences will be saved to the database with the user_id.. so next time just check if the user has already chosen... if yes, get the preferences from database.. if not -> redirect him to do so.
I don't know if that's exactly what you want