WKWebView对象显示交互式Web内容。它由Apple的WebKit提供,可用于macOS,iOS和tvOS。
我遇到一个问题,我的网页在页面右侧添加纯空白,导致水平滚动,但仅在 iOS 中的 WKWebView 中加载时才会出现。在 Safari 中加载时不会...
在我的应用程序中,我尝试使用 URL 加载 webview ,我正在检查它是否在主线程中加载,并使用在主线程中加载 webview DispatchQueue.main.async { self.loadRequest() } , 网络视图洛...
Web 视图需要使用以下语法向 iOS Native WKWebView 发送消息。 window.webkit.messageHandlers.countryListHandler.postMessage("数据") 有没有办法可以这样称呼
我的 swift 应用程序中有一个 WKWebView。我加载了 URL,但网站中有一个地图网站。当我在应用程序上显示它时,我必须捏合缩小才能使其达到所需的缩放比例,以便我看到
我们正在尝试与多个用户进行电话会议,因此通过使用Kurento服务器我们已经实现了这一点,并且它可以在safari浏览器上运行。但是当涉及到在WebView中实现时/
WkWebView:“Mac(专为 iPad 设计)”上的 YouTube iframe 视频质量低
我有一个简单的 WkWebView,嵌入了 YouTube iframe。 我得到了高品质 iPad模拟器 实体iPhone 我只得到低质量的 iPhone模拟器 Mac(专为 iPad 设计) 我尝试过?质量...
我正在开发的应用程序有一个网络视图,可以导航填充一些表单的整个流程,最后显示一个带有导航到主页按钮的完成屏幕。 我的老板想禁用放大功能...
在 Mac 上作为 Catalyst 应用程序运行时,WKWebView 内容太小
我开始通过 Catalyst 路线将我的 iOS 应用程序(适用于 iPhone 和 iPad)移植到 Mac,但 WKWebView 的行为非常奇怪。所有的内容都太小了,看起来它认为最...
我试图在 WkWebView 中显示我之前下载并存储在字符串中的 html 页面。 这就是我设置 WkWebView 的方式: webView = WKWebView(frame: self.blankView.frame) 网络V...
添加WKWebView查看后调用addScriptMessageHandler
我已经在我的类中添加了 WKWebView 来通过扩展 UIViewController 类的代码进行查看,我可以成功地从 iOS 故事板按钮调用 JS 函数。 不过,我希望 JS 能够...
eSIM 二维码长按上下文菜单中的“添加 eSIM”选项 | WKWebView 与 SFSafariViewController
我试图通过 WKWebView 显示 eSIM QR 码,并在用户长按 QR 码时获得“添加 eSIM”选项。 但是当我长按我的设备时,它没有显示“添加 eSIM”选项......
Youtube 不会在 WKWebView iOS 上显示广告
我正在使用 WebKit Swift 在我的应用程序上加载 Youtube 视频,我使用了以下 swift 代码,它可以成功播放 YouTube 视频: Guard let url = URL(string: "https://www.youtube.com/&quo...
SwiftUI 中的 WKWebView 未公开 UserFacing 相机
我的 WKWebView 没有暴露面向用户的相机,即使我特别要求它。它始终使用后置摄像头。 我需要考虑什么特别的事情吗? 如果 url != nil { ...
如何在 WKWebview iOS Swift 中保留 Cookie - iOS 13 SwiftUI
我正在寻找使用 SwiftUI 构建的基于 iOS 13 SDK WKWebview 的应用程序的解决方案,以便在应用程序使用的不同会话之间保存 cookie。 这个问题已经被讨论过很多次了
我有不同的 HTML 模板,我正在尝试从它们中获取“深色模式”。 我通过向其中注入一些 css 来实现这一点。 @media(首选颜色方案:深色){ html{ 菲尔...
网站可以在 Safari 中运行,但不能在 Xcode 中运行 WKWebView
我正在使用 Swift 为 iOS 构建一个非常简单的应用程序。我正在运行 Xcode 13,这是适用于 Mac Big Sur 的最新版本。它只是使用 WKWebView 来加载我的网站。我的网站在
如何同时使用 API loadFileUrl:allowingReadAccessTo: 和 loadHTMLString:baseURL:?
我需要在WKWebView中加载本地源图像和远程源图像。 远程图片的url是相对url。 要在 WebView 中加载本地图像,我可以使用 loadFileURL(_:
当baseURL为null时iOS WKWebView显示空白
以下是我在 WebView 中加载 html 文本的代码 myWebView.loadHTMLString(script, baseURL: nil ) 此代码不适用于以下 html 以下是我在 WebView 中加载 html 文本的代码 myWebView.loadHTMLString(script, baseURL: nil ) 此代码不适用于以下 html <div id="rtb_startapp_ad" style="position:absolute;width:100%;height:100%;"> <div id="grumi-container"><script type="text/javascript" nonce="!headerNonce!">window.grumi = { wver: "1.1.2",wtype: "dfp",key:"6b137966-9f92-4777-a0ab-c91142f2e98f",meta:{adup:"%%ADUNIT%%",dest:"%%DEST_URL_ESC%%",w:"null",h:"null",li:"%eaid!",adv:"%eadv!",ord:"%ebuy!",cr:"%ecid!",ygIds:"%_ygIds!",aduid:"%epid!",haduid:"%esid!",isAfc:"%_isAfc!",isAmp:"%_isAmp!",isEBDA: "%_isEBDA!",qid: "%qid!",cust_imp: "%cust_imp!",cust1:"https://s.adroll.com/a/FZ7/UR4/FZ7UR4ZCO5CN5KCJGY4ZCF.jpg",cust2:"F5TIL4CKCFHJFPG2PAL56I_320x50_1",cust3:"[Nothing]",caid:"%caid!",di:"167496962",dn:"167496962",dcid:"F5TIL4CKCFHJFPG2PAL56I_320x50_1_https://s.adroll.com/a/FZ7/UR4/FZ7UR4ZCO5CN5KCJGY4ZCF.jpg",pid:"pbn",pn:"pbn",adElId: "%_adElId!",topUrl: "%%TOPURL%%" },sp: "dfp",cfg: { advs: "%%advs%%" },pbAdId: "%%PATTERN:hb_adid%%",pbAdIdAst: "%%PATTERN:hb_adid_appnexusAst%%",pbBidder: "%%PATTERN:hb_bidder%%",hbPb: "%%PATTERN:hb_pb%%",hbCid: "%_hbcid!",hbAd: "%_hbad!",hbSize: "%%PATTERN:hb_size%%",hbCurrency: "%_hbCurrency!",hbAdomains: "%_hbadomains",site: "%%SITE%%",pimp: "%_pimp%",pl: "%%preloaded%%",isHb: "%_isHb!",to: "1500" };</script><template style="display: none;" id="template0"><xmp style="display: none;" id="xmp0"> <div style="text-align: center;"><script type="text/javascript">adroll_width = 320;adroll_height = 50;adroll_a_id = 'ABHFO7PVIRG2XD25F4OH54';adroll_s_id = 'ISRFVJ4CYZEJLCRYPCOWW4';adroll_c_id = 'F5TIL4CKCFHJFPG2PAL56I';adroll_render_link = false;adroll_ext_network = 'startapp';adroll_subnetwork = 'm';adroll_ad_payload = '__HIA_MBkwHFA-DIA9wAAY1UTWwbRRT2rgNCFFEoEAQnC6oKoay9O_vj3Qgrsh3_Jf5PYicWZDW7M3Y3Xns363XS5oAqQCCkcqgEHIKQUNUTiEsvXODSjAg_O0ZCCHEoHLghcUBqT4RKrFsqyp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_drcU0AAuZ4mbKfkVg4LAEovKB1FUPBya6WVJAkCxoKCZFksUvZydXIIxbH85KBgAlNpKkAKAKg7FckCi2fzpQP6D3vk2N3_Ca_A8QMjRm1QtoZUNpXp485';adroll_url_macro = 'play.google.com';adroll_cpm_macro = 'ZdKdFQAG4bgGUkPMlipeKYQrRy5zitvbA7CEjg==';adroll_c_macro = '';adroll_imp_macros = [];adroll_win_notif = undefined;adroll_insertion_id = '8460fc0dae7e9355391fc076eda94b63';adroll_ad_type = 'image';adroll_ad_click_tracking_leniency = false;adroll_ad_eid = 'FZ7UR4ZCO5CN5KCJGY4ZCF';adroll_ad_filename = 'FZ7UR4ZCO5CN5KCJGY4ZCF.jpg';adroll_ad_beacon_snippet = '';adroll_advertisable_enable_rollcrawl = false;adroll_ad_custom_evidon_tag = '';adroll_campaign_eid = 'FWQMZQ5ZVZGRBL5XBEVDDL';adroll_campaign_product = 'retargeting';adroll_campaign_type = 'retargeting';adroll_campaign_name = 'General Retargeting Campaign 03-2023 - Web';adroll_advertisable_eid = 'RCOWOEMESVFAJM4E3HYSQQ';adroll_ad_is_liquid = false;adroll_ad_destination_url = 'https://www.duckercarlisle.com/?utm_source=adroll&utm_medium=retargeting&utm_campaign=general-retargeting&adct=gAAAAABl0p0VmWnas2ZZ9gyEnRIsvk-p_cG6WhVD1EpypuaMQcft2kxgBlVuZ10XYkk1sOm-1BO5tnfy3t3nEmO6VAzaR0W7PeG1J4kO2r_kZMyGn_S-g7-d4k2lmPZO0bkIa1Mj_lBg';adroll_ad_destination_url_signature = '53067CFA49AE4985';adroll_ad_parameters = {};adroll_ad_is_outlined = false;adroll_ad_outline_color = '';adroll_ad_html = '';adroll_enable_conversion_measurement = false;adroll_ad_container_version = undefined;adroll_pixalate_click_url = 'https://adrta.com/c?clid=ar&paid=ar&avid=RCOWOEMESVFAJM4E3HYSQQ&caid=FWQMZQ5ZVZGRBL5XBEVDDL&plid=FZ7UR4ZCO5CN5KCJGY4ZCF&siteId=play.google.com&kv1=320x50&publisherId=&kv2=https%3a%2f%2fplay.google.com%2fstore%2fapps%2fdetails%2fCallApp_Caller_ID_Block%3fid%3dcom.callapp.contacts%26hl%3den_US&kv3=400126019f6b6e7f976d4519d522453f&kv4=72.255.89.0&kv7=EHIiAhKjvWA&kv10=[ISP]&kv11=8067226168614744269176524862400802555&kv18=com.callapp.contacts&kv19=[Device_ID]&kv24=Mobile_InApp';</script><script type="text/javascript" src="https://s.adroll.com/j/rolling.js"></script></div> </xmp></template><script type="text/javascript" nonce="!footerNonce!">!function (n) { var e = window.grumi.key,t = window.grumi,o = t && t.wtype && "gpt" === t.wtype,r = window.onerror,i = +new Date,a = navigator.userAgent && navigator.userAgent.match(/(MSIE)|(Trident)|(Edg)/),w = o && !a,o = t.to,o = parseInt(o,10) || 5e3; function u() { var n = function () { for (var n,e = document.getElementsByTagName("template"),t = e.length - 1; 0 <= t; t--)if ("template0" === e[t].id) { n = e[t]; break } return n }(); return n.content ? n.content.getElementById ? n.content.getElementById("xmp0") : n.content.childNodes[0] : n.getElementsByTagName("xmp")[0] } function d() { var n = u(); return n && n.innerHTML } function c(n,e) { e = e || !1,top.postMessage && top.postMessage({ evType: n || "",key: t.key,adup: t.meta.adup,html: window.grumi ? window.grumi.tag : "",el: t.meta.adElId,refresh: e },"*") } var m = !1; function g(n,e) { var t,o; !m && (m = !0,t = "",o = a && "complete" === document.readyState,window.grumi && (window.grumi.fsRan = !0,t = window.grumi.tag),o || (t = t || d(),w && window.document.open(),window.document.write(t),window.document.close()),(e = e || !1) || o) && c(n,o) } function s(n,t) { return function () { var e = setTimeout(function () { var n = document.getElementById(i); n && null === function (n) { if (void 0 !== n.nextElementSibling) return n.nextElementSibling; for (var e = n.nextSibling; e && 1 !== e.nodeType;)e = e.nextSibling; return e }(n) && t && t(),clearTimeout(e) },n) } } s(o,function () { g() })(),s(2e3,function () { c("slwCl") })(),window.grumi.tag = d(),window.grumi.scriptHost = n,window.grumi.pbGlobal = window.grumi.cfg && window.grumi.cfg.pbGlobal || "pbjs",window.grumi.onerror = r,window.parent && window.parent.postMessage && window.parent.postMessage({ iw: !0,key: t.key,adup: t.meta.adup,el: t.meta.adElId },"*"),window.grumiInstance = function () { for (var n = window,e = 0; e < 10; e++) { try { if (n.grumiInstance) return n.grumiInstance } catch (n) { } n = n.parent } }() || { q: [] }; var p = JSON.parse(JSON.stringify(window.grumi)); if (grumiInstance.q.push(function () { grumiInstance.createInstance(window,document,p) }),!grumiInstance.loaded) { o = document.createElement("script"),n = (o.type = "text/javascript",o.src = n + e + "/grumi.js",o.className = "rm",o.id = i,w && (o.async = !0),"_" + +new Date); window[n] = function () { g("netErr",!0) },window.grumi.start = +new Date; try { window.document.write(o.outerHTML.replace('class="rm"','onerror="' + n + '();"')) } catch (n) { g() } } window.onerror = function (n) { "function" == typeof r && r.apply(this,arguments),s(0,g)(),window.onerror = r } }(("http" === window.location.protocol.substr(0,4) ? window.location.protocol : "https:") + "//rumcdn.geoedge.be/");</script></div> <script> function rtb_doStartAppClick(clickUrl){ var z=document.createElement('img'); z.src=clickUrl; setTimeout(function(){},5000); } function rtb_startappShow() { rtb_startappSendImpression(); } function rtb_startappSendImpression(){ if(false != true) { document.getElementById('rtb_trackingUrlImage').src = ''; } if('' != 'null') { document.getElementById('rtb_externaltrackingUrlImage').src = ''; } } function rtb_manageUrls(impUrls) { if (impUrls){ rtb_processUrls(strToArray(impUrls)); } } function rtb_processUrls(urls) { if (urls.length > 0){ for (var i = 0; i < urls.length; i++) { var img = new Image(); img.src = urls[i]; } } } function strToArray(str) { /*var tempStr = str.replace(/[\[\]']+/g,''); Minification issue - turns into "str.replace(/[[]']+/g,'')"*/ var tempStr = str.replace('[','').replace(']',''); return arr = tempStr.split(','); } (function() { document.addEventListener("DOMContentLoaded",onload); function onload() { rtb_manageUrls('[https://d.adroll.com/b/ISRFVJ4CYZEJLCRYPCOWW4/ABHFO7PVIRG2XD25F4OH54/F5TIL4CKCFHJFPG2PAL56I?adroll_network=startapp&adroll_subnet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PP22_v_BhLZEHnadfWpx55eWtQztmP2_6uxU6ftFB7qayuUuUaYAWXXJxHmZYGyG-TB0bY77uk7SR3IuqBQtnNA2c2bwqbsYBK574MXKLsdevtTyr5IuB4cDKBuDULtuWFlMyyD0Rwn8NOZzwlxwMvaHCfGJVERJMqeI_drcU0AAuZ4mbKfkVg4LAEovKB1FUPBya6WVJAkCxoKCZFksUvZydXIIxbH85KBgAlNpKkAKAKg7FckCi2fzpQP6D3vk2N3_Ca_A8QMjRm1QtoZUNpXp485&url_macro=play.google.com&win_url=https%3A%2F%2Fstartapp-winners-us-east-1-rtb.adroll.com%2Fwin%2Fstartapp%3Fpayload%3DAQA0MDAxMjYwMTlmNmI2ZTdmOTc2ZDQ1MTlkNTIyNDUzZgAIYQEoODA2NzIyNjE2ODYxNDc0NDI2OTE3NjUyNDg2MjQwMDgwMjU1NQAIYgCwRldRTVpRNVpWWkdSQkw1WEJFVkRETAAIYwCYaS0wMDRiZDJjYWNkOTgyMjYxMgAIbgAIZgAIdAFAMWVjZTY2YmJhMjEzNGQ5MzZiYmJlY2I4ZTI5YzdkMzY1ODMzZGI5YgAIdg%26price_cpm_dollars%3D&cpm_macro=ZdKdFQAG4bgGUkPMlipeKYQrRy5zitvbA7CEjg==,https://adimpression.startappservice.com/adimpression/api/v1.0/adimp?d=IAAAAAAgAAA6X1tPSEdEUVxeWlBBSkBUS1dVTVxFPQYeHBMAKwodHyYYHRAgHhNbUB0EFlFeWRMbBxwLBRFDU0BNUjIxMS8gICIwNTUwRU8dGToeARsUAisIFEpFWlNCSVNNXlJZWUtLRkFPSk1PQFNdU1NRSEBJWF9eXFZJQFdQQ0lTQEdWX1tGWkFGVF5YXFFARU1XQFdXQU0BXFJFGEYXXEJdDgAcXkAHS0VMSUUBDE5FT0RHUA5aClFIQUNCQ0dRTURGX1BPSkFHUF5bWlFIUEVVT0BQRUJTXFFGT1NFUFINBAhXEBUNHhURAF4GAQ0GGBMAGkxcWFhIQ0RWQURSU0JSU1JcTk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1dZSklRXkBGVlpPSV5ESl5aWFhJUEVVRklRXkFSWVpFTlNFXVpTWktJUEVVRUlQU0FQXF5CWkFBWlItCgkVMgQRUjcAHBwAHEM7PVxUKg4CB0UrFhcOABAEAlBDTjACGB1UKwMBCA4cAVdQQkJcFhEJHQZRSEFCVF5NWlZKTkVCQ0BTTUNXXlJR]'); } })(); (function() { var _body = document.getElementsByTagName('body')[0]; var _fn = function() {rtb_doStartAppClick('https://adclick.startappservice.com/api/v1.0/adclick?d=IAAAAAAgAAA6X1tPSEdEUVxeWlBBSkBUS1dVTVxFPQYeHBMAKwodHyYYHRAgHhNbUB0EFlFeWRMbBxwLBRFDU0BNUjIxMS8gICIwNTUwRU8dGToeARsUAisIFEpFWlNCSVNNXlJZWUtLRkFPSk1PQFNdU1NRSEBJWF9eXFZJQFdQQ0lTQEdWX1tGWkFGVF5YXFFARU1XQFdXQU0BXFJFGEYXXEJdDgAcXkAHS0VMSUUBDE5FT0RHUA5aClFIQUNCQ0dRTURGX1BPSkFHUF5bWlFIUEVVT0BQRUJTXFFGT1NFUFINBAhXEBUNHhURAF4GAQ0GGBMAGkxcWFhIQ0RWQURSU0JSU1JcTkdNXlgrRlFaQUxcOzkxIjU2PSo9N1NHWFIsKis3NiZCQUZcIiQnMSEzNz4xO0xdWFgwPjUmN1dSRE0EChEdFRxXWlpTWFdJUEdXT0FRU0NSUwETFx4RGzAKAhMmEhA%2BBhUGLxcAAAYAEBMrWl1eNFBJUExRT0JXQklVC1sQVEASXQpDX1AYFlkDQxVZXUgGDQJFS0JAClteXkZKSkksPTYoPDVGWlVPKT05JT0aCSYpPiAEAQAjU0FXWV4RCxUVHQYYDiYJHisVAisRHwcAHEBDS0hJWkxfWVxENUE1OzhVMzsmKCs4PyAzWz8vJ1BPOitSQEQZRUA6X0BGTk0mLCgjJCE8P1dVSklRXkBTWVVRTEBJKCEqOSowN1dUQEkiHx0IGw0bGhEAAAAASFBPTllYQVpXSUBdTVZFRERGR19bWlFaRURcJT0nOVNTXV5GSUBESllbVjctMVdXRUlRXkFWXVZRSEFFVAkPBxYcUENRTxAUExsAHAATCxwdGgMLRQYWHldWSklSQkBGWVpPTEBXUFZTGwcXUEVRRklRXkBWWlBRTkdJWEFeSFREEhEDQxJVREZIXwZKT11AC15WRgRBS0RMEEEHEUYGCFBAHxIXSlteViAPFgYYHRoEU0FVVl4UGBwHDExfWVREQ1dQQEZcQFNUXFZPS1NFW1tTWkZIQEJcAAADHRkGHAwBHAICAAwLRgILEhoUHhUVFV1QCAdLH0USX1kKRg4KAU0QUUVSR00IDxAGHAJZXl1cXFAcS1dXQElTFRUGXVRHHBFCC1xaCl1OS0QERRdRQBIDXFoWTEAVC0xfW1VER1pVXERCQk1UQFBRTE02BgAdH0ZIRUkSGxoGHBVGX1RPSFNGWVIDBBEWUxNBRzNBWEJVXFFbWkJFVAIBHwoLHBgAUUZTTUFcTVJGSU1FWkxdW1gsIFdSSklVXkRLXkBGTE1ESltXVgQcEUUHRkBXXUEAVlVfTRJFUUIPU11JXhZUFBVXExZWXAUQGlNBXVInKkZPSklTXERWSFNSXF4UGBwHDExZX1hJUExXTzAoIzEnIiY2WkhDVF9AWlJBQ1dZSklRXkBGVlpPSV5ESl5aWFhJUEVVRklRXkFSWVpFTlNFXVpTWktJUEVVRUlQU0FQXF5CWkFBWlItCgkVMgQRUjcAHBwAHEM7PVxUKg4CB0UrFhcOABAEAlBDTjACGB1UKwMBCA4cAVdQQkJcFhEJHQZRSEFCVF5NWlZKTkVCQ0BTTUNXXlJR&index=0')}; if (_body.addEventListener) { _body.addEventListener('click', _fn); } else { _body.onclick = _fn; } })(); </script> <div id="pixel" style="display:none;"> <img id="rtb_externaltrackingUrlImage" /> <img id="rtb_trackingUrlImage" /> </div> <script> if(false == false) { rtb_startappShow(); } </script></div> 但是如果我在代码中添加一些 baseURL 就可以了 myWebView.loadHTMLString(script, baseURL: URL(string: "https://example.com") ) 知道如何让它在 baseURL 为 null 的情况下工作吗? 不,如果没有baseURL,你就无法让它工作。在您的情况下,您的脚本或 HTML 文件具有一些 href 标记,其中包含与 HTML 文件的基地址相对路径。 loadHTMLString 基本上加载您的 HTML 文件。如果您的 HTML 文件有一些与基地址相关的 href 标记,loadHTMLString 将无法获取该标记。要获取该标签,您必须适当设置 baseURL。
在 WKWebview 上为所选文本呈现自定义菜单时,我使用 UIMenuController。但现在它在 iOS 16 上已被弃用,并出现以下错误 [正文] 使用 UIMenuController 添加项目
使用 WKWebView swift 获取动态加载的 html
我一直在尝试从具有动态/延迟加载的网站加载 HTML。到目前为止,我见过的唯一可行的解决方案是使用 WebView,然后使用延迟(DispatchQueue.main.asyncAfter(dead...