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('//button[@aria-label]', document, null, 7, null);
result.snapshotItem(0).insertAdjacentHTML("afterend", "<a href='javascript:void(0);'><img src='https://cdn-ak.f.st-hatena.com/images/fotolife/j/jigendaddy/20181118/20181118104702.png'></a>");
var result2 = document.evaluate('//button[@aria-label]/following-sibling::a', document, null, 7, null);
result2.snapshotItem(0).addEventListener('click', sample, false);

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