예제 #1
0
 public void InjectCssFile(string CSSFile)
 {
     if (CSSFile.StartsWith("addon://") || CSSFile.StartsWith("vrub://") || CSSFile.StartsWith("plugin://") || PathUtilities.IsInFolder(_addon.BasePath, PathUtilities.GetTruePath(_addon.BasePath, CSSFile)))
     {
         _wkOverlay.TryExecAsyncJS(@"
                     var insertCss = document.createElement('link');
                     insertCss.rel = 'stylesheet';
                     insertCss.href = '" + TranslatePath(CSSFile, _addon.BasePath).Replace("\\", "/") + @"';
                     document.head.appendChild(insertCss);
                 ");
     }
     else
     {
         Logger.Warning("[OVERLAY] Not injecting " + CSSFile + " as it is not in the addon path");
     }
 }