-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlum-href.html
15 lines (14 loc) · 888 Bytes
/
lum-href.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta name="generator" content="BBEdit 11.6" />
</head>
<body>
<p>
This crude bookmarklet scans the current page for <code><a/></code>nchors with a <code>data-url</code> attribute, looks for a URL slug in that data, and adds an <code>href</code> to the <code><a/></code>. It makes the assumption that slugs can always be appended to <code>https://nerdlife.datanerd.us/new-relic/</code> to get a full URL.
By turning these "data url <a/>nchors into real hyperlinks, we get back things like "open in new window/tab".
</p>
<a href="javascript:void($('a[data-url]').map(function(k,item){const url = $(item).data('url');if(!url){return};if(!url.slug){return};if(!url.slug.en){return};const fullUrl = 'https://nerdlife.datanerd.us/new-relic/' + url.slug.en;$(item).attr('href',fullUrl);}))">lum links</a>
</body>
</html>