Pass parameter from popup window to parent on different domains [closed] - javascript

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I open popup window from Javascript that redirects to different domain. User performs few steps there and at the end popup is closed and the result is passed back to Javascript. I've tried calling window.opener.myfunction but it doesn't work with different domains.
Is it possible to achieve that? I think problem is similar to Facebook connect, where in Javascript I get result of the authentication performed in popup window.

It doesn't work for different domains because the Same-Origin policy applies and restricts access of scripts executing from a different domain. What you could do is pass the parameter as part of a query string argument:
Popup Window Opens -> http://mydomain/popup?name=value
http://mydomain/popup?name=value -> http://externaldomain/target?name=value
Through which the other domain would pass back the same parameter:
http://externaldomain/target?name=value -> http://mydomain/result?name=value

Related

How to take a screenshot of active previous window from angular web application? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
Is there any way to take screenshot of previous active window from our web application? As of now I'm using html2canvas to take screenshot of current window of my webapp, but I need to take a screenshot of my previous active window.(Ex : if I open eclipse first and then open my webapp, from webapp I want to take a screenshot of previous active window means eclipse.)
Is it possible from angular or javascript?
No.
JavaScript running in a web browser is sandboxed and instances where it can interact with applications outside the browser are extremely limited. Taking screenshots of other applications is not one of the exceptions.

Is it possible to restrict user from to bookmark a specific web page? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I am developing a webpage with Python(Django) and want to restrict users from to be able to bookmark a specific web page. Is there a solution?
Bookmarks are Browser specific and you cannot intervene with what the user can do with the browser outside of your web application.
If you do not want the user to access the webpage directly, you can implement Authorization with Session IDs to prevent direct access to the specific webpage.
The answer is no, the user can always bookmark a page because it is a browser function.
But you can use sessions. Then make sure that any page request must have an active session ID, otherwise, it will return an error or redirect to the home page.
The user can add a bookmark to the page, but the bookmarks will only work for limited time. He won't able to access the page after the session timeout. This also has the added benefit of making the site impossible to index by the search engines.

how use variable from iframe to another iframe in different domain? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I see this video when the minute 1:49 the user click a button of the color of iframe 2 and change the iframe 1
https://www.youtube.com/watch?v=4nSjykKMi8g
what type of technique could i use for get this
please help me
The frames can't communicate directly but you can communicate via a server you control. This server can be on any domain.
You can push events using AJAX and receive events using server-sent-events. Make sure you're dealing with the cross domain requests appropriately by implementing CORS on the server.

How to detect if parent tab is closed [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I stuck in the problem. I am working on website where I have main page, we can say it Parent page. And through that I am redirecting to other pages in new tab only, to them we can call as Child Page. My question is that, how I can detect on child page that the parent page tab has been closed by user?
I don't know where I can use Javacript or PHP to detecting on every child page.
I want to get the detection on real time. I mean, I do not want to execute function in every 1 minute which check for the value to detect that the parent page was closed.
You can capture the window.onClose event in the parentwindow and send a value to the child window when this happens (set a variable in the child window). Note that the only way to get a reference to the child window is through the return value of window.open(). window.beforeunload might be more widely supported, but it also fires when you go to a different page of your website in the parent page-- this is actually more useful in some cases, especially if the user goes to a new website using the same tab. See How to capture the browser window close event?.

Referrer to get previous page it isn't working always [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
My problem is Referrer to get previous page it is not working right for example if i open my PHP website from google
document.referrer
working right and i get google link but if i open my website from Bing
referrer returns null . I don't know why ? my web site is https . and i need to get from where user come to my website so any body know the reason
You should not rely on referrer, it's a just a HTTP header which may not be included in the request. Here are some cases where document.referer will be empty:
enter site directly
enter site from bookmarks
browser settings
redirect from http <-> https
etc.

Categories