sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

How is "requiresCustomScript" handled when deploying to a NoScript site?

Open dannyjessee opened this issue 9 years ago • 2 comments

Category

  • [x] Question
  • [ ] Typo
  • [ ] Bug
  • [ ] Additional article idea

Expected or Desired Behavior

What is the expected behavior if a solution is deployed to a NoScript site where the (solution).manifest.json file specifies "requiresCustomScript": true? I would expect some kind of warning or error message indicating that the solution cannot be deployed without first disabling NoScript. Is the requiresCustomScript value in the manifest currently being checked and/or used for anything?

Observed Behavior

I did not receive any feedback that I was deploying a solution that requires custom script on a NoScript site. Obviously the solution did not work after it was deployed, but no feedback was given at the time it was being added to the site that would have indicated there may be a problem.

Steps to Reproduce

I built an application customizer extension that leverages custom script to read values from the site property bag. I specified "requiresCustomScript": true in the (solution).manifest.json file. I deployed the .sppkg to my tenant's app catalog (without tenant-scoped deployment) and added it to a NoScript site via Site Contents > Add an app. It appeared in the Site Contents screen and did not give any indication that there would be any issues.

I later deployed this same extension with tenant-scoped deployment and attempted to programmatically register a user custom action on the site with location ClientSideExtension.ApplicationCustomizer and using the ClientSideComponentId of my solution. The user custom action registration succeeded without any errors or other feedback.

Again, obviously in both cases above the solution doesn't actually work, but no feedback was given to the user to indicate that the solution will not work on a NoScript site.

Thanks for any insight or clarification you can provide around this.

dannyjessee avatar Sep 05 '17 12:09 dannyjessee

Thank you for the feedback. We cannot give a warning at package install time on a site collection with NoScript enabled because it is a per component setting. It's possible to have multiple components, some which require custom script and some which do not. Therefore we don't give a warning at install time.

We do not validate the component ID when it is registered. This is by design. You could have a scenario where you add a component that won't work, and then ask the tenant admin to disable NoScript.

GrahamMcMynn avatar Sep 06 '17 21:09 GrahamMcMynn

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

msft-github-bot avatar Jan 29 '20 00:01 msft-github-bot