diff --git a/README.md b/README.md index a2dfa92..396c77a 100644 --- a/README.md +++ b/README.md @@ -23,29 +23,14 @@ function getIPs(callback){ || window.webkitRTCPeerConnection; var useWebKit = !!window.webkitRTCPeerConnection; - //bypass naive webrtc blocking + //bypass naive webrtc blocking using an iframe if(!RTCPeerConnection){ - //create an iframe node that doesn't allow plugins - var iframe = document.createElement("iframe"); - iframe.style.display = 'none'; - iframe.sandbox = 'allow-same-origin allow-scripts'; - document.body.appendChild(iframe); - - //create a nested iframe that doesn't allow javascript - var iframe2 = iframe.contentDocument.createElement("iframe"); - iframe2.sandbox = 'allow-same-origin'; - - //add a listener to cutoff any attempts to disable webrtc when inserting to the DOM - iframe2.addEventListener("DOMNodeInserted", function(e){ - e.stopPropagation(); - }, false); - iframe2.addEventListener("DOMNodeInsertedIntoDocument", function(e){ - e.stopPropagation(); - }, false); - - //get the RTCPeerConnection connection from the nested iframe - iframe.contentDocument.body.appendChild(iframe2); - var win = iframe2.contentWindow; + //NOTE: you need to have an iframe in the page right above the script tag + // + // + //