UiBot : Robots for Everyone!

Your Location: Training Center> Documents > 15.Cross-domain Web pages
15.Cross-domain Web pages

Sometimes a web page under another domain name is embedded within a separate web page by reference or by iFrame nesting which we call "cross-domain web pages.” In this case, for security reasons, different browsers will have different strategies. Let's see a practical experience:

Open Chrome browser; browse the QQ mailbox page


switch to QQ login;

press F12 key;

open Chrome developer mode;

press Ctrl+Shfit+C combination key;

enter Chrome's element viewing function, and move the mouse to the "QQ login" area;

then left click.

Cross-Domain Page Case: QQ Mailbox

It is clear that the domain name of the current web page is mail.qqq.com, but a web page with the domain name xui.ptlogin2.qqq.com is embedded in it. As you can see, the two domain names are not exactly the same. This is a typical cross-domain web page.

In this case, IE browsers do not do have special processing across domains. For security reasons, Chrome browsers will prohibit access to pages under iFrame, including selection of elements, JS, and other operations. That being said, we cannot select the interface elements in QQ login, including login QQ number, QQ password, etc., which makes it even more difficult to automate operation.

How do we deal with this situation? Either choose to use IE browser or turn off Chrome's security settings by starting parameter commands. The security settings for Chrome are described below. Note that before closing, you need to select a temporary directory to store Chrome user data, assuming that it is D: temp.

Right-click the Google Chrome icon, select the attribute - > shortcut, and fill in the startup parameters in the "target" column. The format is as follows:

- disable-web-security - user-data-dir = user data directory.

For example, our Chrome is installed under C: Program Files (x86) Google Chrome Application chrome. Exe, and the user data directory is D: temp. So in format, we should fill in C: Program Files (x86) Google Chrome Application chrome - Disable - web-security-dir = user:\ temp. 41

Closed Security Settings in Chrome

After doing this, we open Chrome again, and you will see that the Chrome address bar will be prompted as follows, and the installed extensions will disappear. Don't worry, this is because Chrome's user data directory has changed. As long as you re-install UiBot's Chrome extension program, you can automate the operation.

Chrome Turns on Display After Closing Security Settings

With the above settings, Chrome can support cross-domain access.

Are You Ready to Explore the RPA World?