@@ -62,10 +62,10 @@ const ContentScript = {
6262
6363 overwriteProperties ( ) {
6464 const overwrittenProperties = new Set ( [
65- { originalMethod : null , parentObject : window . navigator . mediaDevices , methodName : "getSupportedConstraints" , type : "method" } ,
66- { originalMethod : null , parentObject : window . navigator . mediaDevices , methodName : "enumerateDevices" , type : "method" } ,
67- { originalMethod : null , parentObject : window . navigator . mediaDevices , methodName : "getUserMedia" , type : "method" } ,
68- { originalMethod : null , parentObject : window . navigator . mediaDevices , methodName : "getDisplayMedia" , type : "method" } ,
65+ { originalMethod : null , parentObject : window . navigator . mediaDevices , methodName : "getSupportedConstraints" , type : "method" , potentiallyShowContextBanner : true } ,
66+ { originalMethod : null , parentObject : window . navigator . mediaDevices , methodName : "enumerateDevices" , type : "method" , potentiallyShowContextBanner : false } ,
67+ { originalMethod : null , parentObject : window . navigator . mediaDevices , methodName : "getUserMedia" , type : "method" , potentiallyShowContextBanner : true } ,
68+ { originalMethod : null , parentObject : window . navigator . mediaDevices , methodName : "getDisplayMedia" , type : "method" , potentiallyShowContextBanner : true } ,
6969 { originalMethod : null , parentObject : window , methodName : "RTCPeerConnection" , type : "object" } ,
7070 { originalMethod : null , parentObject : window , methodName : "RTCIceCandidate" , type : "object" } ,
7171 { originalMethod : null , parentObject : window , methodName : "RTCPeerConnectionStatic" , type : "object" } ,
@@ -81,9 +81,11 @@ const ContentScript = {
8181 Object . defineProperty ( object , property , {
8282 get : exportFunction ( ( ) => {
8383 if ( ContentScript . shouldOverload ( ) ) {
84- ContentScript . potentiallyShowContextBanner ( ) ;
8584 if ( data . type === "method" ) {
8685 return exportFunction ( ( ) => {
86+ if ( data . potentiallyShowContextBanner ) {
87+ ContentScript . potentiallyShowContextBanner ( ) ;
88+ }
8789 return window . wrappedJSObject . Promise . reject ( new window . wrappedJSObject . Error ( "SecurityError" ) ) ;
8890 } , window ) ;
8991 }
0 commit comments