Client Side Redirects And Transition Type

Add-in Express™ Support Service
That's what is more important than anything else

Client Side Redirects And Transition Type
How to capture client side redirects and transition types 
Ra Ang




Posts: 10
Joined: 2019-09-12
Hi,

I am using add-in express for building my IE Add-On.

In my add-on, I want to know for a redirect, how the redirect has occurred.
Whether it was a forward/backward button click, a link is clicked, or a Refresh button is hit or a server side or client side redirect has occurred.

In case of chrome, web extension APIs provide following event:-
webNavigation.onCommitted

The event provide me the details about the transition type and corresponding status code.
So from these events, I can know whether a back button/forward button/refresh button or a link was clicked
or whether it was a server side redirect or client side redirect has occurred.

How can I get same information about transition type and status code in case of IE?

Thanks in advance,
RA
Posted 12 Sep, 2019 02:06:02 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Ra,

Please download https://www.add-in-express.com/files/howtos/cs/HttpMonitor.zip example. It shows how you can process redirects.
To intercept the Refresh button, you can use the OnBeforeRefresh event of the iemodule. This event is enabled when the 'HandleDocumentUICommands' property is set to true.
Posted 12 Sep, 2019 05:57:04 Top
Ra Ang




Posts: 10
Joined: 2019-09-12
Hi Sergey,

Thanks for the prompt reply.

The above-mentioned sample provides me, how to process server-side redirects and refresh events.
But I want to know how the browser navigated to the particular URL.

Like in case of Chrome, WebNavigation APIs, provide us "TransitionTypes" and "TransitionQualifiers"
From "TransionTypes", we can detect the user clicked a link, or typed an address, or clicked a bookmark.
And from "TransitionQualifiers" we can detect whether it was a server-side redirect or client-side redirect or the user hit the forward button or backward button for the navigation.

You can refer following links: -
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webNavigation/TransitionQualifier
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webNavigation/TransitionType

How can we get same information related Transition in case of IE?
Which events do we need to handle to get same information?

Thanks,
RA
Posted 12 Sep, 2019 07:11:47 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Ra,

Unfortunately, IE API doesn't provide such APIs. IE API is not so flexible as Chrome API.
To detect when the user clicked a link, you can use events of the ADXIEHtmlDocEvents component (just add it to iemodule via the module context menu). Also, BeforeNavigate2, NavigateComplete and DocumentComplete2 events fire when the browser navigates to a web page.
Posted 12 Sep, 2019 07:27:48 Top
Ra Ang




Posts: 10
Joined: 2019-09-12
Hi Sergey,

Thank you for the information.

Thanks,
RA
Posted 13 Sep, 2019 12:41:20 Top
Ra Ang




Posts: 10
Joined: 2019-09-12
Hi Sergey,

In my Add-on for Internet Explorer, I want to add some logic, in the event which gets fired when the user starts writing something in the address bar of the browser.
Also, I want to handle the event for back button click and forward button click of the browser.

Can you please let me know if there are any events for this, and how to add those in the add-on?


Thanks,
RA
Posted 04 Nov, 2019 04:39:14 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Ra,

Unfortunately, there are not such events in the IE object model.
Posted 04 Nov, 2019 09:20:56 Top