hugoabernier / react-application-injectcss

An SPFx extension that injects CSS on every page
38 stars 28 forks source link

Problem getting it to work #2

Open cbourdeau80 opened 5 years ago

cbourdeau80 commented 5 years ago

I added the app to the appcatalog without deploying it to every site. Then in the site I want to use it I added the app. I put a custom.css it the style library and it doesn't work. What I'm I doing wrong?

hugoabernier commented 5 years ago

Thanks for trying the extension, I wrote a few frequently asked questions posts that may help:

Take a look and let me know if you don't have any luck!

cbourdeau80 commented 5 years ago

Hi, I tried something from the third post link that you sent me.

I added the pre-compiled solution to my appcatalog without deploying to every site. Then I modified "EnableApplicationCustomizer.ps1" with my values and I ran it in a powershell session connected to my site using connect-pnponline. No errors, but it doesn't work.

If I close my powershell window and reconnect, when I try to list the UserCustomActions I don't get anything. If I check right after adding it I can see it.

I don't understand why it's not working because I added another extension (modern script webpart) and it's working perfectly.

Do you have any idea of what I should be looking for? Keep in mind I'm not a DEV, just a regular admin ;)

Thanks Christian

On Fri, 7 Jun 2019 at 13:48, Hugo Bernier notifications@github.com wrote:

Thanks for trying the extension, I wrote a few frequently asked questions posts that may help:

Take a look and let me know if you don't have any luck!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/hugoabernier/react-application-injectcss/issues/2?email_source=notifications&email_token=AMI2WM4IDSTPMVFQ3XM4JY3PZKNOJA5CNFSM4HVYWR52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXGQ4GI#issuecomment-499977753, or mute the thread https://github.com/notifications/unsubscribe-auth/AMI2WMYZVUWY4WX2YDFOMLLPZKNOJANCNFSM4HVYWR5Q .

siowfun commented 4 years ago

For site collection with url like https://domain/sites/subSite, the url is pointing to https://domain/ instead of https://domain/sites/subSite 's Style Library.

We can change the InjectCssApplicationCustomizer.ts init for the following to solve that:

customStyle.href = this.context.pageContext.site.serverRelativeUrl + cssUrl;