Bloom.Book.HtmlDom.RemoveFileProtocolFromStyleSheetLinks C# (CSharp) Method

RemoveFileProtocolFromStyleSheetLinks() public method

gecko 11 requires the file://, but modern firefox and chrome can't handle it. Checked also that IE10 works without it.
public RemoveFileProtocolFromStyleSheetLinks ( ) : void
return void
        public void RemoveFileProtocolFromStyleSheetLinks()
        {
            foreach(XmlElement link in SafeSelectNodes("//link[@rel='stylesheet']"))
            {
                var href = link.GetAttribute("href");
                link.SetAttribute("href", href.Replace("file:///", "").Replace("file://", ""));
            }
        }

Usage Example

Example #1
0
 //while in Bloom, we could have and edit style sheet or (someday) other modes. But when stored,
 //we want to make sure it's ready to be opened in a browser.
 private void MakeCssLinksAppropriateForStoredFile(HtmlDom dom)
 {
     dom.RemoveModeStyleSheets();
     dom.AddStyleSheet("previewMode.css");
     dom.AddStyleSheet("basePage.css");
     EnsureHasLinksToStylesheets(dom);
     dom.SortStyleSheetLinks();
     dom.RemoveFileProtocolFromStyleSheetLinks();
 }
All Usage Examples Of Bloom.Book.HtmlDom::RemoveFileProtocolFromStyleSheetLinks