{"id":2480,"date":"2022-08-30T15:25:13","date_gmt":"2022-08-30T15:25:13","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/01\/17\/stagewebviewbridge-javascript-causes-runtime-error-unknown-protocol-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:25:13","modified_gmt":"2022-08-30T15:25:13","slug":"stagewebviewbridge-javascript-causes-runtime-error-unknown-protocol-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/stagewebviewbridge-javascript-causes-runtime-error-unknown-protocol-collection-of-common-programming-errors\/","title":{"rendered":"StageWebViewBridge &#8211; JavaScript causes runtime error (Unknown protocol)-Collection of common programming errors"},"content":{"rendered":"<p>I&#8217;m using the StageWebViewBridge library to display remote web content in my Air for iOS application (Air 3.1, StageWebViewBridge svn_109_build_0.0.723). I&#8217;ve followed the usage guidelines, put the web content up on a server and included the StageWebViewBridge.js script on that page.<\/p>\n<p>To my dismay, the JavaScript file causes a runtime error and halts execution of my scripts on the webpage:<\/p>\n<blockquote>\n<p>uncaught exception: [Exception&#8230; &#8220;Component returned failure code: 0x804b0012 (NS_ERROR_UNKNOWN_PROTOCOL) [nsIDOMLocation.href]&#8221; nsresult: &#8220;0x804b0012 (NS_ERROR_UNKNOWN_PROTOCOL)&#8221; location: &#8220;JS frame :: http:\/\/localhost\/ios\/StageWebViewBridge.js :: anonymous :: line 126&#8221; data: no].<\/p>\n<\/blockquote>\n<p>The faulty line in question reads like this:<\/p>\n<pre><code>setTimeout( function(){ window.location.href=sendingProtocol+'[SWVData]'+btoa( JSON.stringify( _serializeObject ) );},aggregatedCallDelay );\n<\/code><\/pre>\n<p>Who knows what <code>btoa<\/code> refers to in that statement? The <code>sendingProtocol<\/code> is either <code>\"about:\"<\/code> or <code>\"tuoba:\"<\/code> (to deal with endianness, I guess).<\/p>\n<p>Ideas on how to fix this, anyone?<\/p>\n<p id=\"rop\"><small>Originally posted 2014-01-17 07:10:33. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I&#8217;m using the StageWebViewBridge library to display remote web content in my Air for iOS application (Air 3.1, StageWebViewBridge svn_109_build_0.0.723). I&#8217;ve followed the usage guidelines, put the web content up on a server and included the StageWebViewBridge.js script on that page. To my dismay, the JavaScript file causes a runtime error and halts execution of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2480","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2480","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=2480"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2480\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=2480"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=2480"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=2480"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}