void CBrowserView::GetBrowserWindowTitle(nsCString& title) { nsXPIDLString idlStrTitle; if(mBaseWindow) mBaseWindow->GetTitle(getter_Copies(idlStrTitle)); title.AssignWithConversion(idlStrTitle); // Sanitize the title of all illegal characters title.CompressWhitespace(); // Remove whitespace from the ends title.StripChars("\\*|:\"><?"); // Strip illegal characters title.ReplaceChar('.', L'_'); // Dots become underscores title.ReplaceChar('/', L'-'); // Forward slashes become hyphens }