Tag: ios web app

阻止iframe中的链接导航/接pipecordova webview,特别是在ios中

我有cordova应用程序显示外部内容与iframe(在这种情况下youtubeembedded式video) 点击iframe中的链接(如youtube徽标)时,整个webview将导航到youtube网站,而不仅仅是iframe。 (没有能力回去,你需要杀死应用程序),我想阻止的行为。 在android上,cordova插件API暴露onOverrideUrlLoading方法,它应该能够阻止不需要的导航。 (自己还没有testing过) 我还没有find类似的方法在ioscordova类,也没有在ios webview API。 但我不是很熟悉ios。 我也试过(在android&ios上)iframe的沙箱属性https://developer.mozilla.org/en/docs/Web/HTML/Element/iframe#attr-sandbox这适用于防止脚本(不是我需要atm,只是为了检查属性是否在做什么)而不是阻止导航(为了启用导航,您应该添加allow-top-navigation,而我没有)