The Free Software Media System - Server Backend & API
fix reloading plugin pages
Luke Pulverenti641b85ad7b69
diff --git a/MediaBrowser.WebDashboard/Api/PackageCreator.cs b/MediaBrowser.WebDashboard/Api/PackageCreator.csindex 753946ac4d..726205671c 100644--- a/MediaBrowser.WebDashboard/Api/PackageCreator.cs+++ b/MediaBrowser.WebDashboard/Api/PackageCreator.cs@@ -315,16 +315,15 @@ namespace MediaBrowser.WebDashboard.Apihtml = html.Replace("<head>", "<head>" + GetMetaTags(mode) + GetCommonCss(mode, appVersion));- // Inject sripts before any embedded scripts+ // Disable embedded scripts from plugins. We'll run them later once resources have loadedif (html.IndexOf("<script", StringComparison.OrdinalIgnoreCase) != -1){- html = ReplaceFirst(html, "<script", GetCommonJavascript(mode, appVersion, false) + "<script");- }- else- {- html = html.Replace("</body>", GetCommonJavascript(mode, appVersion, true) + "</body>");+ html = html.Replace("<script", "<!--<script");+ html = html.Replace("</script>", "</script>-->");}+ html = html.Replace("</body>", GetCommonJavascript(mode, appVersion) + "</body>");+var bytes = Encoding.UTF8.GetBytes(html);return new MemoryStream(bytes);@@ -446,9 +445,8 @@ namespace MediaBrowser.WebDashboard.Api/// </summary>/// <param name="mode">The mode.</param>/// <param name="version">The version.</param>- /// <param name="async">if set to <c>true</c> [asynchronous].</param>/// <returns>System.String.</returns>- 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("<script src=\"{0}\" async></script>", s);- }- return string.Format("<script src=\"{0}\"></script>", s);+ return string.Format("<script src=\"{0}\" async></script>", s);}return string.Format("<script src=\"{0}\"></script>", s);