Skip to content

Instantly share code, notes, and snippets.

@sonota88
Created April 9, 2011 10:00
Show Gist options
  • Save sonota88/911285 to your computer and use it in GitHub Desktop.
Save sonota88/911285 to your computer and use it in GitHub Desktop.
hatebu-more.user.js
// ==UserScript==
// @name hatebu-more
// @namespace anbt
// @include http://b.hatena.ne.jp/entry/*
// @exclude http://b.hatena.ne.jp/entry?mode=more&url=*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.js
// ==/UserScript==
var moreURL = "http://b.hatena.ne.jp" + $("#more-link > a").attr("href");
var iframe = $("<iframe></iframe>");
iframe.attr("src", moreURL);
iframe.css({ "width": "98%"
, "height": "600px"
// , border: "solid 4px red"
});
var moreLink = $("<a href='" + moreURL + "'>" + moreURL + "</a>");
$("body").prepend(iframe);
$("body").prepend(moreLink);
@NotRealPaz
Copy link

NotRealPaz commented Nov 16, 2017

hi, i try to recreate it.

// ==UserScript==
// @name           hatebu-more
// @namespace      anbt
// @include        http://b.hatena.ne.jp/entry/*
// @exclude        http://b.hatena.ne.jp/entry?mode=more&url=*
// @require        https://code.jquery.com/jquery-3.2.1.min.js
// @run-at       document-start
// ==/UserScript==
(function() {
    'use strict';
    var checkExist = setInterval(function() {
        if ($(".entry-info-title > a")[0].href.length) {
            var moreURL = $(".entry-info-title > a")[0].href;
            var iframe = $("<iframe></iframe>");
            iframe.attr("src", moreURL);
            iframe.css({
                "width": "90%",
                "height": "600px",
                "margin": "0 auto",
                "border": "solid 4px red",
                "margin-top": "100px"
            });

            var moreLink = $("<a href='" + moreURL + "'>" + moreURL + "</a>");
            moreLink.css({
                "margin": "0 auto"
            });
            $("body").prepend(moreLink);
            $("body").prepend(iframe);
            clearInterval(checkExist);
        }
    }, 500);
})();```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment