Prevents hosts from accidentally clicking the pairing links
This commit is contained in:
		
							parent
							
								
									7f34b711a5
								
							
						
					
					
						commit
						803c7d4b4d
					
				
					 1 changed files with 13 additions and 0 deletions
				
			
		
							
								
								
									
										13
									
								
								index.html
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								index.html
									
									
									
									
									
								
							| 
						 | 
				
			
			@ -271,6 +271,9 @@
 | 
			
		|||
              var pairingQueryString = '?name=' + encodeURIComponent( name ) + '&key=' + key + '&pairing=' + encryptedPairing;
 | 
			
		||||
 | 
			
		||||
              tdName.innerText = name;
 | 
			
		||||
 | 
			
		||||
              link.addEventListener( 'click', protect );
 | 
			
		||||
              link.setAttribute( 'data-name', name );
 | 
			
		||||
              link.href = window.location.protocol + '//' + window.location.host + pairingPath + pairingQueryString;
 | 
			
		||||
              link.innerText = link.href;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -336,6 +339,16 @@
 | 
			
		|||
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      function protect( e ) {
 | 
			
		||||
 | 
			
		||||
          var name = e.currentTarget.getAttribute( 'data-name' );
 | 
			
		||||
 | 
			
		||||
          if ( ! confirm( 'If you click this link, you will be revealed ' + name + '\'s pairing! Are you sure you want to do this? Only do this if you\'re actually ' + name + '.\n\nUse right-click to copy the link target instead.' ) ) {
 | 
			
		||||
              e.preventDefault();
 | 
			
		||||
          }
 | 
			
		||||
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
    </script>
 | 
			
		||||
 | 
			
		||||
    <script>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue