Jump to content

Is it possible to set up subresource integrity?

Recommended Posts

I need to add subresource integrity (SI) to my squarespace site, but I have no idea how to do that or if it is even possible. If you aren't familiar with subresource integrity, it is simply including a hash of a javascript file inside the javascript tag that loads that library. The browser uses the hash to ensure that the library being downloaded hasn't changed since the hash was generated.

So for example, here is the tag that loads one of the SquareSpace libraries that my site uses:

 

<script type="text/javascript" crossorigin="anonymous" src="//assets.squarespace.com/@sqs/polyfiller/1.2.2/modern.js"></script>
I need to get an "integrity" attribute in there somehow. Suggestions? 
Link to comment
  • 4 weeks later...
On 10/18/2021 at 7:48 AM, michaelmolloy said:

I need to add subresource integrity (SI) to my squarespace site, but I have no idea how to do that or if it is even possible. If you aren't familiar with subresource integrity, it is simply including a hash of a javascript file inside the javascript tag that loads that library. The browser uses the hash to ensure that the library being downloaded hasn't changed since the hash was generated.

So for example, here is the tag that loads one of the SquareSpace libraries that my site uses:

 

<script type="text/javascript" crossorigin="anonymous" src="//assets.squarespace.com/@sqs/polyfiller/1.2.2/modern.js"></script>
I need to get an "integrity" attribute in there somehow. Suggestions? 

We can't edit how the squarespace assets is loaded, only the one we place on code injection

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.