Enable scripts in SharePoint

%3CLINGO-SUB%20id%3D%22lingo-sub-1458321%22%20slang%3D%22en-US%22%3EEnable%20scripts%20in%20SharePoint%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1458321%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3CBR%20%2F%3EI%20want%20to%20run%20custom%20scripts%20on%20my%20online%20SharePoint%20site%2C%20I%20have%20also%20%3CSPAN%3Eallowed%20users%20from%20running%20custom%20script%20on%20personal%20sites%20in%20SharePoint%20Online%2C%20It's%20already%20been%20more%20then%2024%20hrs%20but%20I%20am%20not%20yet%20able%20to%20execute%20custom%20scripts%20on%20my%20online%20SharePoint%20site.%26nbsp%3B%3CBR%20%2F%3E%3C%2FSPAN%3EPlease%20suggest%20me%20some%20better%20options%20for%20the%20same.%26nbsp%3B%3CBR%20%2F%3EThanks.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1458554%22%20slang%3D%22en-US%22%3ERe%3A%20Enable%20scripts%20in%20SharePoint%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1458554%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F697308%22%20target%3D%22_blank%22%3E%40AkashHolmetrics%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%3CP%3EI%20believe%20you've%20done%20everything%20is%20outlined%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fallow-or-prevent-custom-script%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Ehere%3C%2FA%3E%2C%20perhaps%2C%20there%20might%20be%20just%20a%20missed%20tiny%20tick%20box%20somewhere.%3C%2FP%3E%3CP%3ECan%20you%20tell%20us%2C%20please%2C%20what%20is%20happening%20when%20you%20try%20to%20run%20scripts%3F%20Are%20there%20any%20logs%20available%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1459212%22%20slang%3D%22en-US%22%3ERe%3A%20Enable%20scripts%20in%20SharePoint%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1459212%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F663983%22%20target%3D%22_blank%22%3E%40olegmelnikov%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3EThanks%20for%20reply%2C%20Yes%20I%20have%20done%20as%20suggested%20in%20the%20link%2C%20but%20still%20I%20am%20getting%20this%20error%20while%20executing%20script%20page%2C%20Error%26nbsp%3B%3CBR%20%2F%3E%3CSTRONG%3E%22%20Refused%20to%20execute%20inline%20script%20because%20it%20violates%20the%20following%20Content%20Security%20Policy%20directive%3A%20%22script-src%20'self'%26nbsp%3B%20...............%26nbsp%3B'unsafe-eval'%20.%20Either%20the%20'unsafe-inline'%20keyword%2C%20a%20hash%20('sha256-..........')%2C%20or%20a%20nonce%20('nonce-...')%20is%20required%20to%20enable%20inline%20execution.%3C%2FSTRONG%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1460344%22%20slang%3D%22en-US%22%3ERe%3A%20Enable%20scripts%20in%20SharePoint%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1460344%22%20slang%3D%22en-US%22%3E%3CP%3Ehi%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F697308%22%20target%3D%22_blank%22%3E%40AkashHolmetrics%3C%2FA%3E%2C%3C%2FP%3E%3CP%3EI%20am%20not%20a%20developer%2C%20but%20it%20looks%20like%20there%20is%20nothing%20to%20do%20with%20SharePoint%2C%20the%20script%20starts%2C%20but%20it%20fails%20because%20of%20the%20error.%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcontent-security-policy.com%2F%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EHere%3C%2FA%3E%2C%20I%20found%20some%20clues%20about%20source%20values%20for%20*-src%20directives.%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fstackoverflow.com%2Fquestions%2F30280370%2Fhow-does-content-security-policy-work%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EHere%3C%2FA%3E%2C%20I%20found%20pretty%20good%20guide%20'How%20Content%20Security%20Policy%20works'.%3C%2FP%3E%3CP%3EPlease%2C%20let%20me%20know%2C%20if%20it%20helps.%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hi,
I want to run custom scripts on my online SharePoint site, I have also allowed users from running custom script on personal sites in SharePoint Online, It's already been more then 24 hrs but I am not yet able to execute custom scripts on my online SharePoint site. 
Please suggest me some better options for the same. 
Thanks. 

3 Replies

Hi @AkashHolmetrics ,

I believe you've done everything is outlined here, perhaps, there might be just a missed tiny tick box somewhere.

Can you tell us, please, what is happening when you try to run scripts? Are there any logs available?

Hi @olegmelnikov 
Thanks for reply, Yes I have done as suggested in the link, but still I am getting this error while executing script page, Error 
" Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self'  ............... 'unsafe-eval' . Either the 'unsafe-inline' keyword, a hash ('sha256-..........'), or a nonce ('nonce-...') is required to enable inline execution.

hi @AkashHolmetrics,

I am not a developer, but it looks like there is nothing to do with SharePoint, the script starts, but it fails because of the error.

Here, I found some clues about source values for *-src directives.

Here, I found pretty good guide 'How Content Security Policy works'.

Please, let me know, if it helps.