From 807c1da8e9c55230eccbea609cc71004dc792f7c Mon Sep 17 00:00:00 2001 From: New Author Date: Mon, 20 Jan 2025 10:02:29 -0800 Subject: [PATCH 1/2] Updated the Vanilla JS extension example to work by removing onclick in HTML and adding an eventlistener to handle counter. The onclick within the HTML was causing a CSP violation and wasn't working. --- vanilla/counter/src/index.js | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/vanilla/counter/src/index.js b/vanilla/counter/src/index.js index 72afe22..58be327 100644 --- a/vanilla/counter/src/index.js +++ b/vanilla/counter/src/index.js @@ -25,13 +25,15 @@ import { connectExtensionHost, LookerExtensionSDK40, -} from '@looker/extension-sdk' +} from '@looker/extension-sdk'; -;(async () => { +(async () => { const extensionSdk = await connectExtensionHost() const sdk40 = LookerExtensionSDK40.createClient(extensionSdk) const result = await sdk40.me() const name = result.ok ? result.value.display_name : 'Unknown' + + // Write the HTML content document.write(`