Sandbox: Make jquery available to plugins in the global scope (#75960)

This commit is contained in:
Esteban Beltran
2023-10-04 16:25:47 +02:00
committed by GitHub
parent 3ea6d1f7cc
commit 027028d9a0
@@ -94,6 +94,12 @@ async function doImportPluginModuleInSandbox(meta: PluginMeta): Promise<System.M
// Similar to `window.monaco`, `window.Prism` may be undefined when invoked.
return Reflect.get(window, 'Prism');
},
get jQuery() {
return Reflect.get(window, 'jQuery');
},
get $() {
return Reflect.get(window, 'jQuery');
},
get grafanaBootData(): BootData {
if (!pluginLogCache[meta.id + '-grafanaBootData']) {
pluginLogCache[meta.id + '-grafanaBootData'] = true;