Redirect page without Internet in React - javascript

How can I do, if there is no Internet, the website must go to some redirecting link?
For example, the Instagram page. If I turn off wifi, Instagram redirects me to this page.
Is that possible with react-router? Or What do I have to research?

Related

Wanting to redirect a page to another page from another website that can only be accessed via a login

There is a WordPress website that I don't have access to yet. There is a tool on the website that is outdated.
There is a second website that takes you to a login page. Once logged in, you can access one of the modules on it, which is another tool. The second website is React on the front-end and has a Java/Maven back-end.
I want to redirect the page from the first website (the old tool) to the page from the second website (the new tool), without having to log in on the second website.
What would be the best way to do this? I've never had to do a similar task before.

How are users authenticated and customised pages served before a web page renders without javascript?

A good example of this is facebook's mobile view. This is not reliant on javascript and is able to authenticate the user with the server. If they are authenticated it will request and load your custom webpage, and if not you will see facebook's default home page.
How is all this accomplished without javascript and before the page renders? Is it PHP that runs before the DOM is rendered or is it another technology?
FB uses cookies to handle this. Before the page renders the cookie is sent to the server with the initial page load request, if the cookie is still valid you get past the login page, otherwise you need to login again.
Here is how you can see what cookies you have in chrome:
In the top right, click the Menu Chrome menu.
Click Settings > Show advanced settings.
In the "Privacy" section, click Content settings.
Under "Cookies," click All cookies and site data.
To delete all cookies, click Remove all.
To delete a specific cookie, hover over a site, then click the that appears to the right.
You can also choose to remove all cookies created during a specific time period.
https://support.google.com/chrome/answer/95647?hl=en

Reload web page in GWT

After a user logged and press my page url in this page if user press confirm button i want to relaod my page not the home page
Window.alert(ConstantesMessage.MESSAGE_MSG004);
eventBus.goToMyPage();
Window.Location.reload();
this solution work but it's reload the home page not my page
A GWT application is a single page application. So if you reload the web page you get your start page, unless you use the history tokens. See http://www.gwtproject.org/doc/latest/DevGuideCodingBasicsHistory.html When you have a history token the page is still reloaded, but based on the history token you can open the page you want to show. I guess you don't have the history token set, so you'll get your home page.
As an extra thought. It looks like you built the login in GWT. A better solution is to provide a separate login page. And when the user is successfully logged in then open the application.

how to navigate user from my facebook application's canvas page to my web page?

I am working on a rails application. I have implemented facebook integration in my application. User can invite his friends to my application. Invitation system is working fine but problem is when any friend of user clicks on request it gets redirected to my facebook applications canvas page. I want that the user be redirected to my web applications landing page instead of in the application's canvas page. I tried to do so by including javascript in page which opens in canvas on facebook.
<script>
window.location.href = "http://www.google.com";
</script>
But it is giving me error as following.
Refused to display document because display forbidden by X-Frame-Options.
How to redirect user to my applications landing page as soon as it land son my canvas page? I want to achieve something similar to pinterest does.
Any help is highly appreciated.Thank you
Your frame doesn't have access to the window object, as that'd let you access Facebook's pages and do nasty stuff to them. You need to do top.location.href instead of window.location.href.
Your facebook application is probably sending the X-Frame headers, preventing Facebook to include your application iside the iFrame in the first place.
Some applications include that to prevent clickjacking, see here for an explanation of how it works:
http://blog.mozilla.com/security/2010/09/08/x-frame-options/
You might want to disable that header and then try again.

How to navigate back to the Java appliacation from a web page in Browser Session?

We are developing a Java application for BlackBerry. We have the home screen in which we have various links to open the different versions of the news pages. We have links in these news pages to open the various articles. We need to create a href link in the web page which should act like the home button. When the user clicks on this home button, the application should navigate back to the Home screen. The web pages arer being created by us. So, we can embed any code. Thanks in advance.
This took me awhile to figure out and to get working, but once I did, the concept seemed so simple. Look into BrowserContentProvider. If my memory serves, you can find an example of this in the SDK. Essentially, you can register a BrowserContentProvider with your application. Then, you set up your website link with a certain extension. When the BlackBerry browser doesn't know how to handle that extension, it will go around and "ask" if any other applications know how to handle it. Your application can then recognize it and request the foreground (to open on top of the browser).

Categories

Resources