Implement managed browser security, individual agents and observability
This commit is contained in:
1 parent
ff482ebe23
commit
ea448de2d4
172 files changed
+5404
-347
No files matched your search
@@ -0,0 +1,14 @@
|
||||
'use strict';
|
||||
// A new top-level GET belongs to the live native tab, not the document it leaves.
|
||||
// Data-bearing requests still belong to the exact original document generation.
|
||||
function requestSourceCurrent({details,source,token,registry,currentDocument}){
|
||||
try{
|
||||
if(!token)return !(details.webContentsId>0);
|
||||
if(details.resourceType==='mainFrame'&&details.method==='GET'&&!(details.uploadData?.length)){
|
||||
const contents=token.webContents;
|
||||
return !!source&&source.guarded===true&&source.view.webContents===contents&&!contents.isDestroyed()&®istry.fromContents(details.webContentsId)===source;
|
||||
}
|
||||
return currentDocument(token);
|
||||
}catch{return false;}
|
||||
}
|
||||
module.exports={requestSourceCurrent};
|
||||
Reference in new issue
Block a user