如何在铬中安装用户脚本?

How to install user script in chromium?

我有这个脚本:

// ==UserScript==
// @match https://gitter.im/*
// ==/UserScript==
(function(Notif) {
  function play() {
    var a = document.createElement('audio');
    a.setAttribute('autoplay', true);
    a.setAttribute('src', 'http://www.soundjay.com/button/beep-03.mp3');
  }
  window.Notification = function(title, option) {
    var notif = new Notif(title, option);
    play();
    return notif;
  };
  for (var key in Notif) {
    if (Notif.hasOwnProperty(key)) {
      window.Notification[key] = Notif[key];
    }
  }
})(Notification);

我如何在 chromium 中安装它,我尝试拖放到新选项卡,使用指向我的本地主机的数据 url 创建 url 或将其上传到 gitter 和单击 link 但我总是收到错误消息,提示我不允许安装来自该站点的脚本和扩展程序。

您可以转到设置 -> 扩展程序 (chrome://extensions/) 并将文件拖入 window。 Chromium 将从本地文件安装扩展。

Starting in Chromium 21, it is more difficult to install extensions, apps, and user scripts from outside the Chrome Web Store. Previously, users could click on a link to a *.crx file, and Chromium would offer to install the file after a few warnings. After Chromium 21, such files must be downloaded and dragged onto the Chromium settings page. This setting allows specific URLs to have the old, easier installation flow.