IE 11 – Eternal Night https://www.shuijingwanwq.com There is no problem not worth solving, and no technology not worth learning! Sun, 07 Jun 2026 14:06:44 +0000 en-US hourly 1 https://wordpress.org/?v=7.0 The HTML iframe tag supports all pan-domains under a certain top-level domain name, and restricts the display implementation of other top-level domain names https://www.shuijingwanwq.com/en/2017/10/16/16102/ https://www.shuijingwanwq.com/en/2017/10/16/16102/#respond Mon, 16 Oct 2017 06:00:23 +0000 https://www.shuijingwanwq.com/?p=16102 浏览量: 0

1. In 360 Browser Compatibility mode, this content cannot be displayed in a frame, as shown in Figure 1

This content cannot be displayed in a frame

To help protect the security of the information entered in this website, the publisher of this content is not allowed to display the information in the frame.

在 360 浏览器 兼容模式下,出现 此内容不能显示在一个框架中 的提示

Figure 1

2. Check the source code of the web page, and it is determined that it is caused by the iframe and because of the inconsistency of the URL, as shown in Figure 2

查看网页源代码,确定是由于 iframe 且是因为网址不一致导致

Figure 2

3. Further analysis, the root is that the response header contains: X-frame-options: SameOrigin, as shown in Figure 3

https://developer.mozilla.org/zh-CN/docs/Web/HTTP/X-Frame-Options
Indicates that the page can be displayed in the frame of the same domain name page (that is, it can only be displayed under the TV domain name).

进一步分析,根源在于 响应标头 中包含:X-Frame-Options: SAMEORIGIN

Figure 3

4. Create a new virtual host, TV.EastoBacco.dev, and create a new page header.html, as shown in Figure 4

在本地新建1个虚拟主机,tv.eastobacco.dev,且新建对应的页面 header.html

Figure 4

5. Set the response header of TV.EastoBacco.Dev: x-frame-options: SameOrigin, as shown in Figure 5

设置 tv.eastobacco.dev 的响应头:X-Frame-Options: SAMEORIGIN

Figure 5

6. Create a new virtual host, mytv.eastobacco.dev, and create a new page index.html, as shown in Figure 6

在本地新建1个虚拟主机,mytv.eastobacco.dev,且新建对应的页面 index.html

Figure 6

7. Local reproduction: this content cannot be displayed in a frame, as shown in Figure 7

在本地复现:此内容不能显示在一个框架中

Figure 7

8. TV.EastoBacco.dev, create a new page index.html, which contains the header.html of this domain name, as shown in Figure 8

tv.eastobacco.dev,新建对应的页面 index.html,包含本域名的 header.html

8

9. The prompt that this content cannot be displayed in a framework no longer exists, as shown in Figure 9

此内容不能显示在一个框架中的提示已经不存在

Figure 9

10. Therefore, it can be determined that the response header: x-frame-options: Sameorigin, the main function is to make header.html only be displayed under the TV domain name, but the current requirement is that it needs to be displayed under all secondary domain names, set the response header: x-frame-options: frame-ancestorshttp://mytv.eastobacco.dev, as shown in Figure 10
# add_header x-frame-options Sameorigin;
add_header x-frame-options “allow-fromhttp://mytv.eastobacco.dev”;
add_header x-frame-options “allow-fromhttp://tv.eastobacco.dev”;

可以确定,响应头:X-Frame-Options: SAMEORIGIN,主要的作用是让header.html仅能够在tv域名下展示

Figure 10

11. Repeat the 7th step and find that the header.html can be displayed under the mytv domain name, as shown in Figure 11

重复第7步骤,发现header.html可以在mytv域名下展示

Figure 11

12. Repeat the 9th step and find that the header.html cannot be displayed under the TV domain name, which does not meet the expectations, as shown in Figure 12

重复第9步骤,发现header.html在tv域名下无法展示,不符合预期

Figure 12

13. Reset the response header: x-frame-options: frame-ancestorshttp://*.eastobacco.dev, as shown in Figure 13
add_header x-frame-options “allow-fromhttp://*.eastobacco.dev”;

重新设置响应头:X-Frame-Options: frame-ancestors http://*.eastobacco.dev

Figure 13

14. Repeat step 7 and find that header.html cannot be displayed under the mytv domain name, as shown in Figure 14

重复第7步骤,发现header.html在mytv域名下无法展示

Figure 14

15. Reset the response header: x-frame-options: frame-ancestorshttp://mytv.eastobacco.dev,http://tv.eastobacco.dev, as shown in Figure 15
add_header x-frame-options “allow-fromhttp://mytv.eastobacco.dev,http://tv.eastobacco.dev”;

重新设置响应头:X-Frame-Options: frame-ancestors http://mytv.eastobacco.dev, http://tv.eastobacco.dev

Figure 15

16. Repeat step 7 and find that header.html cannot be displayed under the mytv domain name, as shown in Figure 16

重复第7步骤,发现header.html在mytv域名下无法展示

Figure 16

17. Reset the response header: x-frame-options: frame-ancestorshttp://mytv.eastobacco.dev;http://tv.eastobacco.dev, as shown in Figure 17
add_header x-frame-options “allow-fromhttp://mytv.eastobacco.dev;http://tv.eastobacco.dev”;

重新设置响应头:X-Frame-Options: frame-ancestors http://mytv.eastobacco.dev; http://tv.eastobacco.dev

Figure 17

18. Repeat step 7 and find that header.html cannot be displayed under the mytv domain name, as shown in Figure 18

重复第7步骤,发现header.html在mytv域名下无法展示

18

19. Reference URL:https://blogs.msdn.microsoft.com/ieinternals/2010/03/30/combating-clickjacking-with-x-frame-options/, allow-from does not support wildcards or lists of multiple sources, as shown in Figure 19

参考网址:https://blogs.msdn.microsoft.com/ieinternals/2010/03/30/combating-clickjacking-with-x-frame-options/ ,Allow-From 不支持通配符或多个来源的列表

Figure 19

20. Reference URL:https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Headers/Content-Security-Policy__by_cnvoid, reset the response header: content-security-policy: frame-ancestorshttp://*.eastobacco.dev, as shown in Figure 20
add_header content-security-policy “frame-ancestorshttp://*.eastobacco.dev”;

参考网址:https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Headers/Content-Security-Policy__by_cnvoid ,重新设置响应头:Content-Security-Policy: frame-ancestors http://*.eastobacco.dev

Figure 20

21. Repeat the 7th step and find that the header.html can be displayed under the mytv domain name, which is in line with the expectations, as shown in Figure 21

重复第7步骤,发现header.html可以在mytv域名下展示,符合预期

Figure 21

22. Repeat the 9th step and find that the header.html can be displayed under the TV domain name, which is in line with expectations, as shown in Figure 22

重复第9步骤,发现header.html可以在tv域名下展示,符合预期

Figure 22

23. The header.html under TV in another top-level domain name can still be successfully included, which is not in line with expectations, because the compatibility mode does not support content-security-policy , decided to give up the display limit in compatibility mode, allowing all domain names to contain header.html under TV, as shown in Figure 23

在另一个顶级域名中包含tv下的header.html,仍然可以成功包含,不符合预期,由于兼容模式不支持 Content-Security-Policy ,决定放弃兼容模式下的展示限制,允许所有域名包含tv下的header.html

Figure 23

24. Turn on the speed mode, repeat the 7th step, and find that the header.html can be displayed under the mytv domain name, which is in line with the expectations, as shown in Figure 24

开启极速模式,重复第7步骤,发现header.html可以在mytv域名下展示,符合预期

Figure 24

25. Turn on the speed mode, repeat the 9th step, and find that the header.html can be displayed under the TV domain name, which is in line with the expectations, as shown in Figure 25

开启极速模式,重复第9步骤,发现header.html可以在tv域名下展示,符合预期

Figure 25

26. The header.html under TV is included in another top-level domain name, and it is found that the header.html cannot be displayed, which is in line with expectations, as shown in Figure 26

在另一个顶级域名中包含tv下的header.html,发现header.html无法展示,符合预期

Figure 26

27. Repeat the first step, normal display, in line with expectations, as shown in Figure 27

重复第1步骤,正常显示,符合预期

Figure 27

28. The compatibility mode is actually the IE browser, and the speed mode is actually the Chrome browser. The response head only sets the content-security-policy, then the security settings are abandoned under the IE browser to ensure that under all browsers,http://*.eastobacco.devAll can contain header.html under TV, and other top-level domain names cannot be included.

]]>
https://www.shuijingwanwq.com/en/2017/10/16/16102/feed/ 0
Implement WeChat login in ShopNC, and use Detector to detect browser-related processes https://www.shuijingwanwq.com/en/2016/04/29/16258/ https://www.shuijingwanwq.com/en/2016/04/29/16258/#respond Fri, 29 Apr 2016 05:47:23 +0000 https://www.shuijingwanwq.com/?p=16258 浏览量: 0

1. To realize WeChat login in the WeChat client, the QR code scanning layer will pop up, which should be canceled and directly jump to the authorization page, as shown in Figure 1:

在微信客户端中实现微信登录,弹出二维码扫描层

Implement WeChat login in the WeChat client, and pop up the QR code scanning layer

2. In the mobile browser, the QR code scanning layer will pop up, and an error will be reported after scanning, as shown in Figure 2:

在移动浏览器中,弹出二维码扫描层,扫描之后报错

In the mobile browser, the QR code scanning layer pops up, and an error is reported after scanning

3. Background – Platform – Members – Account Synchronization – WeChat public platform, as shown in Figure 3:
Execute SQL:
Insert into `trade_setting`(`name`, `value`) values (mp_weixin_isuse,1)
Insert into `trade_setting`(`name`, `value`) values (mp_weixin_appid,WX5C318E640E87F7E8)
Insert into `trade_setting`(`name`, `value`) values (mp_weixin_secret,1F436A3A0DBFDAC1C8E1C8F72D2FBEC)

后台 - 平台 - 会员 - 账号同步 - 微信公众平台

Background – Platform – Members – Account Synchronization – WeChat Public Platform

4. Use Detector to detect the browser, the URL:http://detector.dmolsen.com/, it can automatically adapt to the new browser, version and device to use unique user agent characters for each browser, based on Modernizr, as shown in Figure 4:

使用Detector来检测浏览器,网址:http://detector.dmolsen.com/

Use Detector to detect the browser, the URL:http://detector.dmolsen.com/

5. Copy the directory lib/detector to core/framework/detector, as shown in Figure 5:

And set the directory: user-agents/core/, user-agents/extended/, config is writable;

复制目录lib/Detector至core/framework/Detector

Copy directory lib/detector to core/framework/detector

6. The rules are formulated as follows, the code in the controller and template file is shown in Figure 6 and 7:

(1) PC, Tablet: pop up the QR code scanning layer (here WeChat open platform, website application);

(2) Mobile browser: hide;

(3) Mobile client: directly jump to the authorization page (here WeChat public platform, service number);

36kr.com: The mobile terminal does not currently support WeChat login, please use the bound mobile phone or mailbox to log in.
Dianping.com: Hide WeChat login button (use this scheme);

控制器文件中代码

code in controller file

模板文件中代码

code in template file

7. Under the Mobile client, the code to directly jump to the authorization page is shown in Figure 8:

在mobile客户端下,直接跳转至授权页面的代码

Under the Mobile client, jump directly to the code of the authorization page

8. Under the Mobile client, jump directly to the page of the authorization page, as shown in Figure 9:

在mobile客户端下,直接跳转至授权页面的网页

Under the Mobile client, jump directly to the page of the authorization page

9. Error when submitting SVN, as shown in Figure 10:

The working copy at

is too old(format 10) to work with client version1.8.10(R1615264)(Expects format 31).You need upgrade the working copy first.

the working copy at is too old(format 10) to work with client version '1.8.10(r1615264)' (expects format 31)

The working copy at is too old(format 10) to work with client version1.8.10(R1615264)(Expects Format 31)

10. Delete all .svn directories under core/framework/detector to prevent svn conflicts, and the submission is successful, as shown in Figure 11 and 12:

删除core/framework/Detector下的所有.svn目录,以防止SVN冲突

Delete all .svn directories under core/framework/detector to prevent svn conflicts

SVN提交成功

SVN submission was successful

11. Under the Edge browser, the error is reported, as shown in Figure 13:

script16389: Unspecified error.

在Edge浏览器下,报错:SCRIPT16389: 未指明的错误。

Under the Edge browser, an error is reported: script16389: Unspecified error.

12. Open the URL:http://detector.dmolsen.com/, I found that I also have this error, as shown in Figure 14:

打开网址:http://detector.dmolsen.com/ ,发现也有此错误

Open URL:http://detector.dmolsen.com/, found this error too

13. The solution is based on $_SERVER[‘HTTP_USER_AGENT’], if it is IE10, IE11, Edge, then detector is not used to detect the browser, as shown in Figure 15:

基于$_SERVER['HTTP_USER_AGENT'],如果为IE10、IE11、Edge,则不使用Detector来检测浏览器

Based on $_SERVER[‘HTTP_USER_AGENT’], if it is IE10, IE11, Edge, then detector is not used to detect the browser

]]>
https://www.shuijingwanwq.com/en/2016/04/29/16258/feed/ 0