How to open a child browser window and then execute a script on the newly loaded child browser page to click a link in it

StackOverflow https://stackoverflow.com/questions/14534834

  •  05-03-2022
  •  | 
  •  

Question

I have 2 web applications A and B (for those familiar with Zoho, A is Zoho Creator and B is Zoho Invoice)

From web application A, I need to open a page within Application B and get to a particular view in B which can only be obtained by clicking a link on the page in B (as that view is obtained by an AJAX load of the view).

Limitation of B is that it does not expose the particular view I want by means of a URL with paramaeters (i.e. I can't get what I want just by having a new browser window request www.appB.com/somePage?ID=1233. I can only have the new browser window request www.appB.com/somePage and then I need to manually click an AJAX link in B that opens up a view I want).

Limitation of A is that I do not have access to javascript. I have limited means (Zoho Creator's Deluge language) to open another web application in a new browser window. All I can do is give the webpage of A a URL and tell it open it in the same window or a new window. So only manipulative capability I have on webpage of A when opening a new browser window is the new webpage's URL.

What I want to accomplish is - From webpage of A just via URL open new browser window that loads the initial page of B and then my javascript executes and clicks on the link on B that loads the desired AJAX view in the B's browser window.

Any thoughts on how to get this to work? Your inputs are much appreciated and thanks a lot in advance.

Was it helpful?

Solution

To summarize the conclusions in my previous comments:

  1. You cannot inject javascript into a page via the page URL. You could pass parameters in the URL, but the receiving page would need to already be coded to act on those parameters.
  2. You cannot use javascript from one page to act on another page if the two pages are in different domains and not pre-designed to cooperate. This is security restriction called same origin policy which you can read about here.
  3. So, if you can't modify page B in any way and B is in a different domain than A and A and B were not predesigned to cooperate, then you can't click the link in B from A.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top