AbemaTVで移動用のURLリストを作成

このスクリプトFirefoxで動作を保証しないものとします
http://let.hatelabo.jp/jigendaddy/let/hJmd3o2xrq5o.js

// ==UserScript==
// @name         abema_url_list
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://abema.tv/*
// @grant        none
// @require      http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js
// ==/UserScript==
function k_set() {
  var d_url = window.prompt("URLを入力してください", "");
  var d_title = window.prompt("タイトルを入力してください", "");
  if (window.confirm("タイトルは" + d_title + "\nURLは" + d_url + "でよろしいですか?\n一つでも違う場合はキャンセルを押してください")) {
    for (var i = 0; i < 128; i++) {
      if (!("v_url" + (i + 1) in localStorage)) {
        localStorage.setItem("v_url" + (i + 1), "v_" + d_title);
        localStorage.setItem("v_" + d_title, d_url);
        var flag = i + 1;
        break;
      }
    }
  } else {
    flag = 0;
  }
  return flag;
}
var result = document.evaluate('//input[@name="search"]', document, null, 7, null);
result.snapshotItem(0).addEventListener('change', function () {
  if (result.snapshotItem(0).value == "set") {
    var f_lp = 0;
    f_lp = k_set();
    if (f_lp != 0) {
      if ("v_null" in localStorage || "v_" in localStorage) {
        alert("登録処理を中断します");
        localStorage.removeItem("v_null");
        localStorage.removeItem("v_");
        localStorage.removeItem("v_url" + f_lp);
      }
    }
  } else if (result.snapshotItem(0).value == "open") {
    var result2 = document.evaluate('//form[@role="search"]', document, null, 7, null);
    if (document.getElementById("select01") == null) {
      result2.snapshotItem(0).insertAdjacentHTML("beforeend", "<select id='select01'><option value='none'>選択してください</option></select>");
    }
    var result3 = document.evaluate('id("select01")', document, null, 7, null);
    for (var i = 0; i < 128; i++) {
      if ("v_url" + (i + 1) in localStorage) {
        var d_title = localStorage.getItem("v_url" + (i + 1))
        var d_url = localStorage.getItem(d_title);
        d_title = d_title.replace("v_", "");
        result3.snapshotItem(0).insertAdjacentHTML("beforeend", "<option value='" + d_url + "'>" + d_title + "</option>");
      } else {
        break;
      }
    }
    result3.snapshotItem(0).addEventListener('change', function () {
      var selectedValue = $("#select01").val();
      location.href = selectedValue;
    });
  }
});
select {
  -moz-appearance: menulist;
  -webkit-appearance: menulist;
}