What does tstbklt () do from the jumbler tumblr booklet?

javascript: var d = document,
    w = window,
    e = w.getSelection,
    k = d.getSelection,
    x = d.selection,
    s = (e ? e() : (k) ? k() : (x ? x.createRange().text : 0)),
    f = 'http://www.tumblr.com/share',
    l = d.location,
    e = encodeURIComponent,
    p = '?v=3&u=' + e(l.href) + '&t=' + e(d.title) + '&s=' + e(s),
    u = f + p;
try {
    if (!/^(.*\.)?tumblr[^.]*$/.test(l.host)) throw (0);
    tstbklt();
} catch (z) {
    a = function () {
        if (!w.open(u, 't', 'toolbar=0,resizable=0,status=1,width=450,height=430')) l.href = u;
    };
    if (/Firefox/.test(navigator.userAgent)) setTimeout(a, 0);
    else a();
}
void(0)

Here is the code from the Tumblr bookmarklet. I understand everything, but I can’t find out what the function is for tstbklt();...

I'm just curious who has an idea?

+3
source share
1 answer

The function is tstbkltdisplayed only at http://tumblr.com/goodies (account required), as shown below:

function tstbklt() {
    alert('You\'ve successfully installed the bookmarklet!');
    return false;
}

On any page except the tstbklt function, an error will be selected and the sentence will be executed catch.

+3
source

Source: https://habr.com/ru/post/1770496/


All Articles