diff --git a/MediaBrowser.WebDashboard/Api/PackageCreator.cs b/MediaBrowser.WebDashboard/Api/PackageCreator.cs index 753946ac4d..726205671c 100644 --- a/MediaBrowser.WebDashboard/Api/PackageCreator.cs +++ b/MediaBrowser.WebDashboard/Api/PackageCreator.cs @@ -315,16 +315,15 @@ namespace MediaBrowser.WebDashboard.Api html = html.Replace("", "" + GetMetaTags(mode) + GetCommonCss(mode, appVersion)); - // Inject sripts before any embedded scripts + // Disable embedded scripts from plugins. We'll run them later once resources have loaded if (html.IndexOf("", GetCommonJavascript(mode, appVersion, true) + ""); + html = html.Replace("", "-->"); } + html = html.Replace("", GetCommonJavascript(mode, appVersion) + ""); + var bytes = Encoding.UTF8.GetBytes(html); return new MemoryStream(bytes); @@ -446,9 +445,8 @@ namespace MediaBrowser.WebDashboard.Api /// /// The mode. /// The version. - /// if set to true [asynchronous]. /// System.String. - private string GetCommonJavascript(string mode, string version, bool async) + private string GetCommonJavascript(string mode, string version) { var builder = new StringBuilder(); @@ -482,11 +480,7 @@ namespace MediaBrowser.WebDashboard.Api { if (s.IndexOf("require", StringComparison.OrdinalIgnoreCase) == -1) { - if (async) - { - return string.Format("", s); - } - return string.Format("", s); + return string.Format("", s); } return string.Format("", s);