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

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Keyword Highlighter
If you find my answer fit your need, 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.