Questions tagged [locker-service]

Locker Service is a set of new security features for Lightning Components.

Filter by
Sorted by
Tagged with
1 vote
1 answer
67 views

Using External Custom Web Component in LWC

I wanted to know if it's possible to integrate an external standard web component in LWC. Like suppose I have mycomponent.min.js which exposes my-custom-component. And I want to use it in html as <...
user9158002's user avatar
0 votes
1 answer
46 views

What is the LWS distorted behavior of Document.prototype.execCommand?

According to Salesforce's documentation, the distorted behavior of Document.prototype.execCommand is described as: When an HTML document has been switched to designMode, its document object exposes ...
Swisher Sweet's user avatar
3 votes
1 answer
261 views

In uncompiled code, async await syntax is not supported by Lightning Web Security

Looking at how the new Lightning Web Security (LWS) will affect our Lightning components. I ran the ESLint rules and one recurring error I keep seeing is: In uncompiled code, async await syntax is ...
Swisher Sweet's user avatar
0 votes
0 answers
95 views

LWC with external js lib not loading when use LWS security checkbox is checked

We have DHTMLX Gantt library loaded in a LWC and deployed to multiple orgs, and we are facing this issue where if we uncheck the "use LWC Lightning Web Security for Lightning web components and ...
Rohit's user avatar
  • 13
0 votes
1 answer
180 views

LWC Error: createClient is not defined when using Supabase JavaScript library

I am trying to use the Supabase JavaScript library in an LWC Documentation initializing supabase Supabase JavaScript library: supabase-js@2 Their example from the documentation: import { ...
Robs's user avatar
  • 9,027
0 votes
1 answer
123 views

Passing array to lightning-modal is being flattened

I am trying pass in a simple array to a base lightning-modal component. import MyModal from 'c/myModal'; //This is extending LightningModal from 'lightning/modal' options = ['a','b','c']; async ...
Bryan Anderson's user avatar
1 vote
1 answer
211 views

2023 - Lightning Web Components and Angular

We have a 2GP that has a Lightning Component (Aura/Canvas) that displays our content inside of iframes. Our platform makes heavy use of Angular 15 and many Angular components like Angular Materials, ...
nstuyvesant's user avatar
2 votes
1 answer
647 views

Is there a decent WYSIWG HTML editor that will run inside an LWC?

We have some requirements pushing us towards a better HTML editor than the default rich text field editor. The first one I found Googling is from Froala but a few years ago it didn't work inside an ...
Keith C's user avatar
  • 134k
0 votes
2 answers
221 views

Unable to access DOM elements in Lightning Component

I have a lightning component that displays a modal when a button is clicked. Based on the ID stored in the dataset of the clicked element when the modal is loaded the action should look for a div that ...
dkeefer's user avatar
2 votes
1 answer
379 views

Is it possible to disable Locker Service for LWC

I'm developing lwc and I'm using api version 56.0 and would like to use indexedDB for offline cashing. It looks like it's currently not supported. Is it possible to disable locker service for specific ...
Muhammad Refaat's user avatar
0 votes
1 answer
169 views

Locker Service SecureWindow returning undefined nodes in Selection API

I'm building an LWC with a dependency on the Selection API. Nodes referenced in Selection or Ranges (i.e. window.getSelection()) behave as expected except where a node in the range or selection is a ...
Long Chonks's user avatar
2 votes
0 answers
156 views

Salesforce Lightning Locker Service / Aura Component Range Inconsistencies

In my Salesforce Lightning Locker Service / Aura Component application there seems to be 2 representations for range objects: Type 1. prints to console as Proxy {} does not implement range....
James's user avatar
  • 81
1 vote
1 answer
160 views

Salesforce Lightning Component Range Object compatibility issues

I'm experiencing Lightning Web Components Range proxy behavior that is not expected, on API 55. Creating a new Javascript Range object in a Locker Component: // <div class="container" lwc:...
James's user avatar
  • 81
0 votes
0 answers
333 views

Any way to embed Google Charts in LWC or any charts to present percentage in addition to absolute value?

I would like to present a chart in my LWC with both absolute value and percentage. This can be easily achieved if data is exported to Google Docs and then Google Chart is created from the data. There ...
Patlatus's user avatar
  • 15.8k
1 vote
0 answers
247 views

Unable to load DHTMLX Spreadsheet JS into LWC

Background I am trying to use DHTMLX Spreadsheet in an LWC I've added the JS and CSS as Static Resources: DHTMLX_Spreadsheet_JS DHTMLX_Spreadsheet_CSS And I have enabled Use Lightning Web Security ...
Robs's user avatar
  • 9,027
3 votes
1 answer
3k views

How do I import and use js static resources in LWC?

I'm trying to use a static resource in a Lightning Web Component. The component is embedded in a Sites (formerly known as Communities) Page, in case that matters The relevant code in the static ...
SarcasticSully's user avatar
2 votes
1 answer
910 views

Unable to load Editor.js into LWC

I am trying to use Editor.js within an LWC Editor.JS source file. I've added the 3rd party library as a Static Resource And the LWC JS file is: import { LightningElement } from "lwc"; import ...
Robs's user avatar
  • 9,027
2 votes
1 answer
465 views

Salesforce Community: Send event from window to LWC

I'm working on the LWC that sends an event to Google Tag Manager via window.dataLayer.push(). I have the Lightning Locker service enabled, so I cannot access the window property fully. I can push to ...
Frelseren's user avatar
  • 143
1 vote
0 answers
732 views

jspdf not opening generated PDF(datauristring) in new tab in aura component

I am trying to generate pdf and open it in a new tab using an aura component. Doing this with API version 50 gives me an error (due to locker service probably) Uncaught SecureWindow.open supports http:...
N_H1922's user avatar
  • 315
2 votes
0 answers
190 views

LWC SecureWindow's window.scrollX and window.scrollY returning 0 regardless of scroll amount?

I'm noticing that window.scrollX and window.scrollY are returning 0 from the Locker Service's SecureWindow wrapper regardless of how far the window is scrolled in either direction. Not only does it ...
tjnoe's user avatar
  • 21
6 votes
0 answers
860 views

How to disable lightning locker service by default in community

I have an lwc component to display charts using chartjs library in the community. The component was working perfectly in internal salesforce but the chartjs library failed to load in the community. By ...
Anmol Kumar's user avatar
  • 3,559
5 votes
2 answers
2k views

LWC - Iterating over arrays passed into the component by a parent is ridiculously slow

Imagine we have a parent component where we create an array like so: @track stuff = []; connectedCallback() { let newArray = []; for (let s = 0; s < 10000; s++) { newArray....
zaitsman's user avatar
  • 1,870
6 votes
1 answer
587 views

How do I use Privileged Script in Summer 21?

Salesforce mentions a new feature, Privileged Script, as part of Summer 21: With Privileged Script, third-party JavaScript libraries can access components in LWR sites. An LWR site encapsulates all ...
Rob's user avatar
  • 2,112
3 votes
1 answer
2k views

LWC optional chaining "array?.length' in expression causes output of "[object Object]"

Context: In my LWC, I have an array that may not be defined, and I want to check its length. So I use the optional chaining arr?.length to not error if the array is undefined. I also want to default ...
Andy Ray's user avatar
  • 1,359
0 votes
1 answer
1k views

How to access browser's "window" object in Aura component

I have third party JS file that I have imported in Salesforce as Static Resource Structure of static resource: myuploadzip.zip ----myuploadzip.JS I have imported the same in Aura Application as below:...
Aniruddha's user avatar
0 votes
0 answers
104 views

How do I use react-beautiful-dnd with a lightning web component?

I want to use the react-beautiful-dnd library in a lightning web component. This worked in the past with aura but it does not work with lightning web components. Why would this be? Is this prevented ...
gburnett's user avatar
  • 181
0 votes
1 answer
214 views

Close custom multipicklist dropdown on click of another multipicklist

I have to build an app page with several filters that can be choosen from multiple picklists. There isn't a stantard Lightning Web Components that let me choose multiple options from a picklist ...
Stefano 's user avatar
1 vote
0 answers
3k views

LWC JS loadScript

I am trying to load this JS script: http://cdn.tagcommander.com/3468/tc_ENGIE_iframe.js So I downloaded it as static resource and use loadScript in LWC: import { loadScript } from "lightning/...
Ludodo's user avatar
  • 71
0 votes
0 answers
222 views

What is lwc doing to custom ES6 Proxies?

The Problem: I am experiencing broken behavior when I pass Proxies as Event details or as public properties. Requirement: they need to wrap a {nested: {value: "Foo"}}. I experienced this ...
itsmebasti's user avatar
  • 6,329
2 votes
1 answer
1k views

Stripe with Salesforce (using LWC)

Is it possible to integrate to Stripe using a Salesforce LWC? I am having an issue trying to submit a valid test card to Stripe. Is LockerService blocking this somehow? I have the below LWC code, ...
Breandán's user avatar
0 votes
0 answers
51 views

Event.target doesn't work under Locker service

controller.js selectedValue: function(component, event, helper) { let componentDiv = event.target; let searchString = document.createRange(); } component: <aura:iteration items="{!v....
Abhishek siva's user avatar
5 votes
1 answer
1k views

Is it possible to use the Intersection Observer JavaScript API in LWC?

I'm trying to do some UX updates to a component and I'd like to use the Intersection Observer functionality (https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API) to show/hide a ...
Richard Durrant's user avatar
1 vote
1 answer
739 views

Integration of tinyMce with LWC is not working

I am trying to use tinyMce Rich text editor in an application based on LWC instead of lightning-input-rich-text. I uploaded tinymce.min.js file in static resources and is using that in my component ...
AdityaHM's user avatar
  • 133
-1 votes
1 answer
291 views

Lightning Locker is blocking HTMLScriptElement

I'm trying to inject a script into the lightning page by adding the JS Script into the pagebut i'm not able to see any Error or script in the page from Locker Compatibility HTMLScriptElement element ...
Mohammed Al-said's user avatar
1 vote
1 answer
246 views

Load scripts in lightning web component with out strict mode

I'm trying to load a library into a lightning web component. The library itself has comments in it that say it shouldn't run in strict mode which I think is what's causing my issue since I can get the ...
Scott Morrison's user avatar
1 vote
0 answers
2k views

Failing this.template.querySelector

I have a component and am trying to retrieve an element from the template using querySelector, as follows: const elt = this.template.querySelector('.thunder-ng'); But instead of returning the element,...
kamezaburo's user avatar
0 votes
0 answers
36 views

Global marker for UI test automation in aura

What is a good way to set a "marker" for a UI test automation? Right now my application has quite a bit of background server calls that I want to wait to complete. I am considering adding ...
dzh's user avatar
  • 4,204
0 votes
1 answer
173 views

Dynamically alter CSS depending on Salesforce standard split view mode being expanded or collapsed

When I am trying to view a record detail page in split view mode I have to alter CSS on my custom component depending on whether the Split view section is expanded or collapsed. In order to accomplish ...
Rohit Maharashi's user avatar
0 votes
1 answer
36 views

WheelEvent constructor does not work in LockerService

When trying to create a WheelEvent using its constructor, I was unable to do so, despite the WheelEvent being clearly marked as supported in the Locker Api Viewer. The issue is reproducible easily by ...
Louis Bompart's user avatar
1 vote
0 answers
1k views

Failed to execute 'add' on 'HTMLSelectElement': The provided value is not of type '(HTMLOptionElement or HTMLOptGroupElement)'

There is library written in vanilla js for datatable Vanilla-Datatables, I am trying to use that library to create datatables. HTML: <template> <div class="container-fluid"> ...
Nagendra Singh's user avatar
5 votes
1 answer
3k views

Google Analytics Event Tracking in Community using LWC

I'd like to use Google Analytics Event Tracking inside a Community in LWC We have Google Analytics configured in Builder > Settings > Advanced > Google Analytics The documentation says to ...
Robs's user avatar
  • 9,027
3 votes
1 answer
1k views

LWC: Second async child function call fails

I would like to call an async function on a child component from its parent. This works the first time I call the function, but the second time, I get a "Sorry to interrupt" error with this:...
Matthew Souther's user avatar
4 votes
1 answer
5k views

Animate custom refresh lightning-button-icon LWC

I want animate a lightning-button-icon as the standard Salesforce refresh button in LWC. I've already seen a related question but the answer was not conclusive, at this point I don't know if it's ...
Rui Vieira's user avatar
2 votes
0 answers
106 views

Are URLs for Salesforce files brittle?

I'm using Salesforce Files with enhanced letterheads with a URL like the following: <img alt="Company_letterhead_header" src="https://my-domain--c.na191.content.force.com/file-asset-public/...
Cleverlemming's user avatar
1 vote
0 answers
338 views

How to add Custom HTML in Lightning Component Dropdown Menu? [closed]

I'm trying to create a dropdown menu with specialized internal options. SLDS Menu - https://lightningdesignsystem.com/components/menus/ Respective Lightning Component for this is - https://...
VarunC's user avatar
  • 5,828
1 vote
0 answers
1k views

Can access elements with template.querySelectorAll() in Local Dev Server, but not with Locker Service running

I have written a custom LWC with some nested accordians. I have a function that expands all similarly named child accordion sections in the each of the parent accordion sections. I was able to get it ...
Kurt Fairfield's user avatar
0 votes
1 answer
2k views

How to access the contents of a SecureNodeList in Lightning Components

I am currently trying to access a SecureNodeList, but I keep running into errors. Before I go into depth more, I will explain what I am trying to do first, before I end up with an X-Y Problem. My aim ...
Roti's user avatar
  • 355
0 votes
1 answer
708 views

Locker Service Blocking Access to Third-Party Object

I'm running into a scenario where I can't tell if Locker is preventing accessing an API call from a third-party script that's been whitelisted. I'm using Qualtrics survey tool to poll users on our ...
Matt Smith's user avatar
3 votes
1 answer
56 views

LockerService Range.commonAncestor readonly field returns a function instead of a Node (or SecureElement)

I've found a strange behavior with LockerService and I do not understand the current behavior. I want to use Range.commonAncestorContainer but when I try to use this getter, I get a function instead ...
Louis Bompart's user avatar
2 votes
1 answer
5k views

LWC: Using lwc:dom="manual" to reach and interact with a certain DOM element

I am trying to find a way to interact with the built-in chat widget. I need to simulate a click on it. I understand that the Locker Service is there to prevent any interaction outside of the DOM of ...
Arthlete's user avatar
  • 4,773

1
2 3 4 5
8