【问题标题】:Can I set my website as default homepage for chrome我可以将我的网站设置为 chrome 的默认主页吗
【发布时间】:2017-09-24 15:41:26
【问题描述】:

我可以将我的网站设置为 Google Chrome 浏览器的主页吗?我可以为 IE 做。

我的 IE 代码。

    RegistryKey startPageKey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Internet Explorer\Main", true);
    startPageKey.SetValue("Start Page", "http://example.com/");
    startPageKey.Close();

【问题讨论】:

  • Java 还是 C#?哪一个?
  • C# 或 javascript

标签: java c# google-chrome


【解决方案1】:

chrome 设置位于 %USERPROFILE%\Local Settings\Application Data\Google\Chrome\User Data.ChromotingConfig.json 和 npocmaka 提到的有点加密。

但您可以采取一种解决方法,例如将以下 javascript 粘贴到“主页”首选项字段(在您的 Chrome 选项下),并在单击“主页”按钮时按预期工作。

javascript:(function(){ window.location.href='http://www.google.com/';})();

【讨论】:

  • 但是我将如何以编程方式完成此操作
【解决方案2】:

在 chrome 扩展的帮助下,我也能做到这一点

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-04-05
    • 1970-01-01
    • 1970-01-01
    • 2012-08-13
    • 2020-10-25
    • 1970-01-01
    • 2017-02-22
    相关资源
    最近更新 更多