Refreshing same browser window from windows run command - javascript

I have one web application. When client enters the address and after successfully logging in. He gets the home page with some data over the page. Now when any third party tool or from run command if i give the same url on which the client is with changed parameter values, i want the same browser window to be refreshed with updated/changed values without opening the new browser window.
Whats happening now is that when i'm triggering the url from different source, its opening in new browser window. Plz help me out with few suggestions.
Ars.

The best solution would be for the web application to poll the server and refresh itself when there is an update.
Your command line tool can then contact the server and update the parameters directly, and the application in the user's browser will pick up those changes automatically.
Attaching to a running Internet Explorer instance is also possible, for example see this article: http://www.codeproject.com/Articles/9683/Automating-Internet-Explorer, or the Selenium project at http://seleniumhq.org/. But you're almost certainly going to make it easier for yourself by changing your application to refresh automatically.

Related

Force one tab only on web app (e.g. similar to WhatsApp and Google Messenger)

I have a strict requirement to only allow a logged in user to open my web app in one tab. I've noticed that WhatsApp and Google Messenger's web apps have implemented this. For example, trying to open those apps in more than one tab (be it on the same browser, different browser, or even different device) results in these warnings:
Anyone know how this is done? There must be some sort of sync happening between the server and the client to ensure that only one tab is open. But this would require a unique tab identifier, which can get quite complicated to build reliably. Anyone know how WhatsApp and Google Messenger are doing it? Their technique seems to work flawlessly.
I don't know exactly how this is done at WhatsApp and Google Messenger, but if you work with WebSockets (your post hast the tag "websocket", so I assume, you do) every tab has its single connection to the server, and if your users need to be logged in you could check if the user has already a open weboscket connection to your server.

How and why does Weinre refresh client browser when pressing F5 in local browser?

I am developing web application on SAMSUNG devices, namely signage displays. That means TVs that are suitable for b2b long term use. We have been developing since Orsay and are currently developing on SAMSUNG's Tizen.
Basically we develop a web application, package it into a suitable Tizen widget using the Tizen SDK, put the widget and configuration on a server, connect a display to that server which will then download the application, install it and run it.
To monitor the application we are using Weinre. To do so we run a Weinre server and connect displays to that server using a line like this one:
<!-- WEINRE Remote include -->
<script type='text/javascript' src='http://thisissome.weinreserver.com:8081/target/target-script-min.js#WEINRE'></script>
When the respective page is loaded in the browser, a list of connections is displayed, there is a console available as well as a view of the DOM (basically like Web Inspector).
Now to my question.
I discovered recently that pressing F5 in the browser, while having one of the Weinre list entries selected, will not only refresh the browser page, but also force a refresh onto the web application that is being monitored. Put bluntly: I am loading the webpage that displays clients currently connected to my Weinre server. Then I select one of the entries displayed. Press F5. The browser window refreshes and the web-application on my display reloads as well.
Therefore I presume, something along the lines of
window.location.reload(false);
is being passed to the display-browser, because I can replicate the same behavior using this command to reload the browser page.
How does Weinre issue this command to the client?
Why does the reload trigger on F5, but not when manually clicking Refresh in my browser (here Chrome)?
Can I prevent this? E.g. could this be related to a setting of our Weinre server or some client setting? I scoured the Weinre documentation to find something related, but did find nothing. Could be a bug, could be a feature.
Hopefully I provided enough information. Apologies if something is missing.

How to detect web page crash (not browser crash) using PHP?

How can we detect through PHP or maybe in node.js or other languages if a web page crashed (without the browser EXITing) so that when a user press the "reload" button on the "Aw Snap" page in chrome certain specific content inside the page can be shown in this particular case (crash case).
In a crash without EXIT, a browser shows per example in Google Chrome the famous "Aw, Snap!" page.
I don't want to know how to capture if the user refreshed the page or the page reloaded which can be known quite easily with different methods [one example see this PHP this code which can detect if users refreshed the page on major desktop/mobile browsers except IE unfortunately this code does not capture a crash event and the fact that user might request again the same page after a crash.
I tried using "register_shutdown_function", and some other maneuvers using connection PHP functions like "connection_aborted" etc... but with no success. I figure out a sloppy way through the use of session variables but probably there are better clever manoeuvres.
Any help or suggestion would be greatly appreciated. Any solution in nodejs will be also welcomed.
web brower crash because too many process from your browser to PC of Client.
this crash can't detected by php because PHP server scripting. and you have question.., why not use JS for detect crash of browser?, because JS created just for controller website,. if you force to checked that use ajax, node, etc you can't do that, why? because the problem comes suddenly
and detected crash browser from php is impossible.

Close a browser tab opened by Android app

I have an issue where I'm asking my app to open a browser looking at my Server.
From that server page, The user can perform some stuff on an existing site, then redirects the user to a URL that the App catches and the App continues as normal.
The lifecycle looks like this:
App -> Web Site -> App
However, after the life cycle of the app and the app is closed, the webpage is still open in the browser (on the page where the redirect to the app occurred).
It's apparently difficult via javascript to close a tab which wasn't opened by javascript? (In my case, the tab was opened by the app, not by a different tab). Is there any way to get around this?
(I'm aware I could use a WebView, but WebViews are buggy, manufacturer specific, security holes that I want to avoid)
No, sorry. There is no standard Intent structure for this. While it is possible that some browsers offer something, I am not aware of any that do.
Bear in mind that there is no requirement that your ACTION_VIEW Intent open up a browser tab, as the user's chosen browser may not offer any sort of tab UI metaphor. check this reference old question

Looking for a script that can be ran in Chrome to automatically reset the browser settings.

What I'm looking to do is create a script that we could place on people's desktop to reset some settings back to where I want them for internal web application?
The script will need to reset everytime a user opens and closes the browser.
As far as my knowledge says, you cannot just edit settings of a browser without attaining user's permissions. So, it will be better to write a chrome plug-in application and ask you web application users to install that first.
You can identify the plug-in status in your web application.

Categories

Resources