logicr
V2EX  ›  Node.js

如何防止 Android 网页自动复制红包码自动复制到剪切板?

  •  
  •   logicr · Aug 20, 2018 · 4923 views
    This topic created in 2871 days ago, the information mentioned may be changed or developed.
    场景:我用 Fusion App 将网页做成客户端,但是在看视频的时候点击播放或者其他按钮就会触发自动复制红宝码的事件。
    问题:怎么用 jQuery 来阻止,播放那块是 iframe。
    2 replies    2018-08-20 23:24:01 +08:00
    8qwe24657913
        1
    8qwe24657913  
       Aug 20, 2018
    同域 iframe 可以 hook Document.prototype.execCommand DataTransfer.prototype.setData Clipboard.prototype.write Clipboard.prototype.writeText,跨域 iframe 只能用 iframe sandbox 强行禁掉脚本执行,也许就无法播放了
    logicr
        2
    logicr  
    OP
       Aug 20, 2018
    @8qwe24657913 谢谢,应该是跨域的吧,我能做的就是外部添加一点点 Query,我想问有没有可以屏蔽掉点击触发的捆绑的事件的方法,比如覆盖掉之类的。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5460 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 08:10 · PVG 16:10 · LAX 01:10 · JFK 04:10
    ♥ Do have faith in what you're doing.