Prevent SWT Browser Widget modal dialog popups - browser

On my application, I'm using the SWT browser widget to check for network connectivity. The reason for this is long, but long story short I HAVE to use the browser widget to check for connectivity. Unfortunately, on Mac and Debian, I get a modal dialog that pops up and tells me that the page load failed.
This message is being passed from the native browser and the SWT browser widget is passing this message through, displaying it as a modal dialog box. I need to intercept this message and handle it, displaying a more useful message to users in the event of a "Page load failed". Here's a screenshot of what it looks like:
Does anyone know how to intercept these messages instead of displaying them to the user?

Few days ago, there was almost same question How to detect internet connection with SWT browser (or handle server not available). Check the answer for code, which might help you..

Related

How does Blazor hijack the Browser-Back button?

Blazor-Server apps use the SignalR circuit.
I can somewhat understand how there is JS that change events happening from the DOM, so instead of sending a new HTTP GET request the framework manipulates the DOM and displays the new blazor page.
But how is it even possible that the circuit is still active and working on page back button? This is a BROWSER FEATURE, not some html element, which can be changed, right? Would it not be a security issue if the browser back button behavior can be manipulated in different ways?
Not firing a new HTTP GET request on page back seems pretty hacky. Wouldn't that allow for malicious websites to do the same? Can websites access the last page visited with that??
How does the browser "know" that the last page should also use the same websocket circuit?
Is it then possible to tell the browser that it should establish a websocket on a past page, that didn't even have any before (would seem like a security risk)?
How does the back button differ from hitting "enter" in the address bar (which will always cut and establish a new circuit)?
Is the back button exactly the same as calling JS history.back() ?

Checking other users are viewing this page in Node Express

I have a NodeJs Express app and when a particular user goes to a page/route would like to identify and display if another user is currently viewing the page as well. So for example it would say "Jerry currently viewing this page" and someone else goes there.
Is there any easy/lightweight way to do this?
First off, with a regular web page, the server only knows who and when a page was requested. It doesn't, all by itself, know whether that user is still viewing that page or not. The user could have closed the browser, typed something else in the URL bar, the computer could have gone to sleep, etc...
Second off, even if the page is still being displayed in the browser, you can't know if someone is actually there at the computer or not. The best you could do is to try to keep track of activity in that web page (last mouse click, recent mouse movements over the web page, etc...).
Then, to even have any idea of the web page is even still open in the browser, you need some way of tracking that notion. There are two possibilities I can think of.
You can have some Javascript in the web page that regularly (say once every few minutes) sends a small little ajax call to your server that basically just says "I'm still here". This wouldn't know immediately when they left the page, but if the server finds that the usual every few minutes ajax call didn't come, then the server can change the status of that user on that page to not there any more.
If that web page makes a webSocket or socket.io connection to the server and keeps that connection alive, then whenever the browser closes or the user closed that tab or navigates to another page, that webSocket or socket.io connection will get automatically closed and the server will be notified that the socket got closed. Using this technique, the server can know pretty much right away when the user leaves the page.

Pop-Up Message With out opening a page

Well, This is the thing, I was navigating the internet any page, and suddenly, A Pop Up windows appeared on screen from my ISP (To remind me I didn't pay today) ... so Do you know how to send that kind of messages without opening the webpage or installing anything on a pc?
I was navigating the internet any page...
Since your internet access is through the ISP, they have the ability to manipulate the traffic coming through their hardware. This includes replacing the content of a site, appending content, or inserting content.
Obviously they can't alter the actual site, but if you request "foo.com" and you haven't paid your bill, they can return whatever they want in response to your request.
They could return <script>window.open()</script> + the HTML content of "foo.com". Invalid, but browsers will render it. They could return a warning page. They could return an HTTP status code. You get the idea.
If you didn't have your web browser open, then something is installed in the background (whether or not you know it). Most hardware comes with dozens of background services which try to be "helpful".

browser related question

I get different behavior between IE and Mozilla.
Say for ex I have 2 buttons on my webpage. Button-1 and Button-2
In mozilla browser, when I click Button-1 then it process the click request of Button-1, while it is processing the request, immediately if I Click on button-2, browser will not proceed request for Button-2.
In IE browser, after clicking Button-1 If I immediately click Button-2 then it will first process request of Button-1 and then it will process request for Button-2.
Why there is different behavior for both browser for same web page?
PS. IE 8 and Mozilla 3
Thats's life
Browser differences are one of the biggest hurdles in modern web development. You're best bet is to paste the code to let users take a look.

Browser navigation, back button issue

I want to know how you guys deal with back button issues in your web applications.
I can not forbid users to click back button on their browser, but when they hit it, the page code doesn't run. So writing in page_load() makes no sense.
I have searched online and found this link: Disabling Back button on the browser. It does not work for me. Any idea?
There is no way to disable the back button. You can try to open your page/form in a new window so there would be nothing to navigate back to
Normally, If I have a critical or lengthy form, I tend to maintain a dirty-flag and if the user starts entering something, the dirty-flag gets set and on save or submit it gets reset. You can use unload/beforeunload javascript event to see if the dirty-flag is set and ask for confirmation.

Resources