mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
chore: Add new webFrame IsolatedWorldInfo API and deprecate (#16801)
* chore: Add new webFrame IsolatedWorldInfo API and deprecate * Flag deprecated methods in documentation * address comments * Address review comments * remove unused variable * Update based on review
This commit is contained in:
committed by
John Kleinschmidt
parent
1f458eb177
commit
3dfef4a376
@@ -2,6 +2,7 @@
|
||||
|
||||
const { EventEmitter } = require('events')
|
||||
const binding = process.atomBinding('web_frame')
|
||||
const { deprecate } = require('electron')
|
||||
|
||||
class WebFrame extends EventEmitter {
|
||||
constructor (context) {
|
||||
@@ -47,6 +48,23 @@ class WebFrame extends EventEmitter {
|
||||
get routingId () {
|
||||
return binding._getRoutingId(this.context)
|
||||
}
|
||||
|
||||
// Deprecations
|
||||
// TODO(nitsakh): Remove in 6.0
|
||||
setIsolatedWorldSecurityOrigin (worldId, securityOrigin) {
|
||||
deprecate.warn('webFrame.setIsolatedWorldSecurityOrigin', 'webFrame.setIsolatedWorldInfo')
|
||||
binding._setIsolatedWorldSecurityOrigin(this.context, worldId, securityOrigin)
|
||||
}
|
||||
|
||||
setIsolatedWorldContentSecurityPolicy (worldId, csp) {
|
||||
deprecate.warn('webFrame.setIsolatedWorldContentSecurityPolicy', 'webFrame.setIsolatedWorldInfo')
|
||||
binding._setIsolatedWorldContentSecurityPolicy(this.context, worldId, csp)
|
||||
}
|
||||
|
||||
setIsolatedWorldHumanReadableName (worldId, name) {
|
||||
deprecate.warn('webFrame.setIsolatedWorldHumanReadableName', 'webFrame.setIsolatedWorldInfo')
|
||||
binding._setIsolatedWorldHumanReadableName(this.context, worldId, name)
|
||||
}
|
||||
}
|
||||
|
||||
// Populate the methods.
|
||||
|
||||
Reference in New Issue
Block a user