2021년 4학년 1학기 기업연계프로젝트2 컴퓨터소프트웨어공학과 <원광투어팀> 팀장 : 송유진 팀원 : 김나영, 이경희, 한유진
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
2.0 KiB

5 years ago
  1. using UnityEngine;
  2. using System.Collections;
  3. namespace Valve.VR
  4. {
  5. public class SteamVR_Windows_Editor_Helper
  6. {
  7. public enum BrowserApplication
  8. {
  9. Unknown,
  10. InternetExplorer,
  11. Firefox,
  12. Chrome,
  13. Opera,
  14. Safari,
  15. Edge,
  16. }
  17. public static BrowserApplication GetDefaultBrowser()
  18. {
  19. #if UNITY_EDITOR
  20. #if UNITY_STANDALONE_WIN
  21. const string userChoice = @"Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice";
  22. using (Microsoft.Win32.RegistryKey userChoiceKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(userChoice))
  23. {
  24. if (userChoiceKey == null)
  25. {
  26. return BrowserApplication.Unknown;
  27. }
  28. object progIdValue = userChoiceKey.GetValue("Progid");
  29. if (progIdValue == null)
  30. {
  31. return BrowserApplication.Unknown;
  32. }
  33. string browserId = progIdValue.ToString().ToLower();
  34. if (browserId.Contains("ie.http"))
  35. return BrowserApplication.InternetExplorer;
  36. else if (browserId.Contains("firefox"))
  37. return BrowserApplication.Firefox;
  38. else if (browserId.Contains("chrome"))
  39. return BrowserApplication.Chrome;
  40. else if (browserId.Contains("opera"))
  41. return BrowserApplication.Opera;
  42. else if (browserId.Contains("safari"))
  43. return BrowserApplication.Safari;
  44. else if (browserId.Contains("appcq0fevzme2pys62n3e0fbqa7peapykr8v")) //AppXq0fevzme2pys62n3e0fbqa7peapykr8v
  45. return BrowserApplication.Edge;
  46. else
  47. return BrowserApplication.Unknown;
  48. }
  49. #else
  50. return BrowserApplication.Firefox;
  51. #endif
  52. #else
  53. return BrowserApplication.Firefox;
  54. #endif
  55. }
  56. }
  57. }