Alok Mysore
Alok Mysore

Reputation: 616

Programmatically open a Javascript bookmarklet in a window opened by parent window

I have a parent window that opens a child window with some URL. Is it possible for the parent window to programmatically execute a Javascript bookmarklet in the child window?

Is this possible (If so how?) or is it prohibited due to security reasons?

Edit

To clarify,

1) The parent window has code that I write.

2) The child window could be any webpage, most often not of the same origin.

3) I want to be able to open a Javascript bookmarklet in the child window from the Javascript code I write in the parent window.

Upvotes: 1

Views: 99

Answers (2)

T.J. Crowder
T.J. Crowder

Reputation: 1074295

The child window could be any webpage, most often not of the same origin.

This is the key point.

No, you cannot access the child window, not even to run a bookmarklet in it.

Upvotes: 1

Bergi
Bergi

Reputation: 664513

No, that an arbitrary website does execute javascript in some arbitrary other page is prohibited for security reasons. Fortunately.

Upvotes: 1

Related Questions