JavaScript/userAgent:修订间差异

来自康健生活
Kangkk​(留言 | 贡献)
Kangkk​(留言 | 贡献)
第20行: 第20行:
(iframeRef.current.contentWindow || iframeRef.current.contentDocument)?.navigator?.__defineGetter__('userAgent', function () {
(iframeRef.current.contentWindow || iframeRef.current.contentDocument)?.navigator?.__defineGetter__('userAgent', function () {
   return 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.109 Safari/537.355';
   return 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.109 Safari/537.355';
});</syntaxhighlight>|{{consoleout|<pre>
});
iframeRef.current.contentWindow.navigator.userAgent</syntaxhighlight>|{{consoleout|<pre>
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.109 Safari/537.355'
</pre>}}}}
</pre>}}}}

2022年2月24日 (四) 08:35的版本