Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [locker-service]

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

Filter by
Sorted by
Tagged with
1 vote
0 answers
44 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 ...
user avatar
  • 8,223
2 votes
1 answer
82 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 ...
user avatar
1 vote
1 answer
125 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 ...
user avatar
  • 8,223
1 vote
1 answer
108 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 ...
user avatar
  • 133
0 votes
0 answers
276 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:...
user avatar
  • 155
2 votes
0 answers
84 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 ...
user avatar
  • 21
0 votes
0 answers
59 views

Using Lightning Container within LWC/Embedded Service?

I've been experimenting with the use of Lightning Containers within the embedded service. The necessary HTML is hosted as a SF static resource. However, when I point to it with the lightning container,...
user avatar
5 votes
0 answers
274 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 ...
user avatar
  • 3,229
5 votes
2 answers
1k 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....
user avatar
  • 1,576
6 votes
1 answer
336 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 ...
user avatar
  • 2,092
3 votes
1 answer
602 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 ...
user avatar
  • 1,151
0 votes
1 answer
541 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:...
user avatar
0 votes
0 answers
48 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 ...
user avatar
  • 171
0 votes
1 answer
94 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 ...
user avatar
1 vote
0 answers
1k 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/...
user avatar
  • 71
0 votes
0 answers
147 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 ...
user avatar
  • 6,120
2 votes
1 answer
692 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, ...
user avatar
0 votes
0 answers
42 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....
user avatar
5 votes
1 answer
460 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 ...
user avatar
1 vote
1 answer
323 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 ...
user avatar
  • 113
-1 votes
1 answer
146 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 ...
user avatar
1 vote
1 answer
62 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 ...
user avatar
1 vote
0 answers
827 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,...
user avatar
0 votes
0 answers
29 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 ...
user avatar
  • 4,429
0 votes
1 answer
112 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 ...
user avatar
0 votes
1 answer
31 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 ...
user avatar
1 vote
0 answers
662 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"> ...
user avatar
4 votes
1 answer
1k 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 ...
user avatar
  • 8,223
3 votes
1 answer
669 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:...
user avatar
4 votes
1 answer
3k 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 ...
user avatar
2 votes
0 answers
80 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/...
user avatar
1 vote
0 answers
179 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://...
user avatar
  • 5,596
1 vote
0 answers
793 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 ...
user avatar
0 votes
1 answer
1k 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 ...
user avatar
  • 335
0 votes
1 answer
492 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 ...
user avatar
3 votes
1 answer
55 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 ...
user avatar
2 votes
1 answer
3k 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 ...
user avatar
  • 4,441
0 votes
0 answers
344 views

Script in ltng:require Blocked by Locker Service

I added a JavaScript file to a Static Resource and I'm using ltng:require to reference it in a Lightning component. <ltng:require scripts="{!$Resource.MyCommunity + '/js/myscript.js'}" ...
user avatar
1 vote
1 answer
1k views

Handsontable 3rd party library not working in LWC

Handsontable is a neat looking spreadsheet plugin for Javascript. I can't get even the quick start to display in an LWC component. It seems to initialize but the data never shows up. As far as I ...
user avatar
  • 63
12 votes
3 answers
9k views

Modern JavaScript Frameworks (Angular Js, React JS ) within LWC

As documented on the below link, https://developer.salesforce.com/docs/component-library/documentation/lwc/lwc.get_started_supported_javascript Lightning Web Components Javascript support includes :...
user avatar
0 votes
1 answer
880 views

Is it possible to call an intranet or local server using a lightning component?

For example, if a local server outputs a JSON with sensitive information, and I can access it through my local network, can I access this data using a lightning component?
user avatar
3 votes
1 answer
4k views

Is it possible to disable Locker Service for Lightning Web Components? (I mean LWC and not Aura Components!)

Is it possible to disable Locker Service for Lightning Web Components? For Aura Components it goes like this: https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/...
user avatar
  • 33.6k
3 votes
0 answers
1k views

AuraError: Error at new Aura.externalLibraries

Background I am using this approach Call REST API from Lightning Components without Named Credentials to call the Salesforce REST API from a Lightning component. It works when I call this URL: /...
user avatar
  • 8,223
0 votes
1 answer
1k views

jQuery/DataTable methods in Lightning Web Component - (...).DataTable is not a function

I'm trying to write a Lightning Web Component which uses jquery and datatable static resources and getting an annoying error message without any idea how to solve it. My html code is: <div class="...
user avatar
  • 358
0 votes
1 answer
342 views

Lightning data locker restricting Javascript for CSS/HTML

I am trying to retrieve JavaScript Static resource in Community lightning component to override the numbering from Unescaped html. But the data locker service is blocking the script. Am trying to ...
user avatar
  • 23
1 vote
1 answer
740 views

LockerService seems to be blocking adding new properties to JS objects in LWC [duplicate]

I am facing issue with LWC, probably connected to the LockerService's Proxy objects. My code I am getting the list of custom objects defined in one of my Apex classes by calling Apex method from LWC ...
user avatar
  • 694
0 votes
2 answers
878 views

Locker Service and 3rd party library, how to pass Security review?

Is it a way to use 3rd party library/framework like Vue/Angular and bypass security review by Salesforce. Because only option to use those kind of library seems possible with version 39.0 which is ...
user avatar
  • 101
5 votes
5 answers
2k views

FullCalendar V4 is not working in lightning component

I am trying to show calendar view using fullcalender.io v4 in lightning component. Initially the fullcalender loads without any issue but when I hover over the calender UI, I'm getting the below ...
user avatar
  • 84
2 votes
1 answer
1k views

jsPDF and Salesforce Lightning Web Component

I'm trying to create a Salesforce Lightning Web Component to create a custom Quote PDF using jsPDF. I mastered to use the external chart.js library with uploading it as a static resource, but when I ...
user avatar
  • 21
1 vote
1 answer
189 views

Iframe allow tag not supported in lightning component?

I tried adding the allow="microphone" tag in iframe that I added in salesforce lightning component, but when I load the page it throws a Uncaught AuraFriendlyError. Is it not supported, also if not is ...
user avatar

1
2 3 4 5
8