检测浏览器是否能够自动隐藏地址栏

时间:2017-09-25 08:32:32

标签: javascript css mobile

我不打算强制更改浏览器自动隐藏地址栏行为

我只想检测浏览器是否会改变它在滚动上的视口高度/能够这样做

为什么呢? 固定height: 100% object-fit: coverprivate readonly string _monitorPath; public void Monitoring() { Console.WriteLine($"*** START MONITOR FOLDER: {this._monitorPath} ***"); var fileSystemWatcherSyncFolderUserSettings = new FileSystemSafeWatcher { Path = _monitorPath, NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite | NotifyFilters.FileName | NotifyFilters.DirectoryName, InternalBufferSize = 24576, }; fileSystemWatcherSyncFolderUserSettings.Changed += OnChanged_SyncFolderUserSetting; fileSystemWatcherSyncFolderUserSettings.Created += OnChanged_SyncFolderUserSetting; fileSystemWatcherSyncFolderUserSettings.Deleted += OnChanged_SyncFolderUserSetting; fileSystemWatcherSyncFolderUserSettings.Renamed += OnRenamed_SyncFolderUserSetting; fileSystemWatcherSyncFolderUserSettings.Error += OnError; fileSystemWatcherSyncFolderUserSettings.IncludeSubdirectories = true; fileSystemWatcherSyncFolderUserSettings.EnableRaisingEvents = true; } private static void OnChanged_SyncFolderUserSetting(object source, FileSystemEventArgs e) { switch (e.ChangeType) { case WatcherChangeTypes.Created: Console.WriteLine($"Created file: {e.FullPath}"); break; case WatcherChangeTypes.Deleted: Console.WriteLine($"Deleted file: {e.FullPath}"); break; case WatcherChangeTypes.Changed: Console.WriteLine($"Change file: {e.FullPath}"); break; } } private static void OnRenamed_SyncFolderUserSetting(object source, RenamedEventArgs e) { // Show that a file has been renamed. Console.WriteLine($"Renamed file '{e.OldFullPath}' to '{e.FullPath}'"); } private static void OnError(object source, ErrorEventArgs e) { // Show that an error has been detected. Console.WriteLine($"Error - The FileSystemWatcher has detected an error : {e.GetException().Message}"); // Give more information if the error is due to an internal buffer overflow. if (e.GetException().GetType() == typeof(InternalBufferOverflowException)) { Console.WriteLine(("Error - The file system watcher experienced an internal buffer overflow: " + e.GetException().Message)); } } - 当地址栏被隐藏时显示丑陋。

0 个答案:

没有答案