1300

移行用のテストです

Googleウェブ検索でURLをまとめてコピー

// ==UserScript==
// @name         google_copy_url
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://www.google.com/search?*
// @grant        none
// ==/UserScript==
var result3 = document.evaluate('//div[@class="r"]/a[1]', document, null, 7, null);
var u_list = "";
for (var i = 0; i < result3.snapshotLength; i++) {
  u_list = u_list + " " + result3.snapshotItem(i).href;
}

var result = document.evaluate('//div[@class="g"][1]//div[@class="r"]', document, null, 7, null);
result.snapshotItem(0).insertAdjacentHTML("afterbegin", "<a href='javascript:void(0);'><img src='https://cdn-ak.f.st-hatena.com/images/fotolife/j/jigendaddy/20181023/20181023214613.png'></a>");
var result2 = document.evaluate('//div[@class="g"][1]//div[@class="r"]/a[1]', document, null, 7, null);
result2.snapshotItem(0).addEventListener('click', sample, false);

function sample() {
  var sign = window.prompt("url_list", u_list);
}