简体   繁体   中英

How to let my website open another website in a new window, and then fill out the forms and submit in that new window (no query params possible)?

Here we have following website: https://aspen.eccouncil.org/VerifyEval

A website should have a link, which opens that URL in a new window, then fills out the "Candidate Name" and "Certificate Number" fields on that page, then finally submits it, so the user sees the verification directly (without having to type those parameters manually).

I tried to use the window.open() function with javascript for the both mentioned websites, and then accessing the document property of the created object. But it failed (even if I put the new window to the focus), Chrome not worked at all, Firefox gave:

Error: Permission denied to access property "document"

What is the way to do that?

Modern browsers won't allow you to execute code on different domains. The reason is simple - if it can be done, a malicious attacker could use this approach to lure you click on a link and then execute code on this page with your permissions (for example: execute code on your bank website). Moreover, the site you trying to execute code on should protect itself from receiving such forms submissions - it's called Cross-Origin Resource Sharing (CORS) protection.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM