The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,862 other subscribers

Archive for the ‘Bookmarklet’ Category

Newer WordPress bookmarklets for navigating from a blog post to the classic editor, or getting the canonical url anchor of a blog post

Posted by jpluimers on 2024/08/08

Last year I posted about Some JavaScript bookmarklets for WordPress published pages centered around navigation and IDs.

It depended on HighlanderComments to exist in order for getting its .connectURL which contains the canonical blog post URL (i.e. from https://wiert.me it obtains https://wiert.wordpress.com).

Nowadays HighlanderComments does not always exist, but in that case <link rel="EditURI" type="application/rsd+xml" title="RSD" href="https://wiert.wordpress.com/xmlrpc.php?rsd"> does exist.

Its’ href value can be obtained by querying document.querySelector('link[rel="EditURI"]').href and truncate it, so I made some conditional code that first tries the HighlanderComments and defers code obtaining it from the link element I mentioned above.

I also added proper Bookmarklet wrappers so the function results don’t leak to the console or Browser (Firefox really does not like Bookmarklets without this wrapper).

javascript:(function(){
//Statements returning a non-undefined type, e.g. assignments
})();

Firefox also dislikes pasting code into the development console.

Code:

Read the rest of this entry »

Posted in Bookmarklet, Chrome, Development, Firefox, JavaScript/ECMAScript, Power User, Scripting, Software Development, Web Browsers | Leave a Comment »

Important to defeat Twitter wrongly auto-guessing of URLs (and assuming anything with @ or # is a mention or hashtag) is Nelson’s Weblog: tech / zero-width-space

Posted by jpluimers on 2024/07/11

Quoting in full from [Wayback/Archive] Nelson’s Weblog: tech / zero-width-space to demonstrate a zero-width-space problem with WordPress too.

Read the rest of this entry »

Posted in Bookmarklet, Classic editor, Development, Gutenberg editor, JavaScript/ECMAScript, Power User, Scripting, SocialMedia, Software Development, Twitter, Web Browsers, Web Development, WordPress | Leave a Comment »

Should be easy to put in a Bookmarklet: Archive.is blog — What is the long version of the url please. …

Posted by jpluimers on 2024/07/10

[Wayback] Archive.is blog — What is the long version of the url please. …

Click on “share” button to see different forms of linking to a page.

For example https://archive.vn/Aoans/share

So there are two tricks:

Read the rest of this entry »

Posted in Bookmarklet, Development, JavaScript/ECMAScript, Power User, Scripting, Software Development, Web Browsers | Leave a Comment »

Reminder to self: write a Bookmarklet that shortens YouTube URLs to the youtu.be ones

Posted by jpluimers on 2024/07/02

When sharing YouTube videos via the mobile apps, they are shortened using the youtu.be domain.

So this is a reminder to write a Bookmarklet based URL-shortener myself for this and extend it so it also understands the various YouTube URL parameters (like start time).

The transformation is documented:

Read the rest of this entry »

Posted in Bookmarklet, Conference Topics, Conferences, Development, Event, JavaScript/ECMAScript, Power User, Scripting, Software Development, Web Browsers, Web Development | Leave a Comment »

Some notes on Fierit

Posted by jpluimers on 2024/04/30

Since I had only one read-only account and the Fierit ECD system won’t sent me update notifications on that account, I have collected some links before actually doing deeper investigation to see how to build a push notification system around it.

Link dump:

Read the rest of this entry »

Posted in Bookmarklet, Chrome, Development, Google, JavaScript/ECMAScript, Power User, Scripting, Software Development, Web Browsers, Web Development | Leave a Comment »

Reminder to self: pointers to recovering “The Great Suspender” suspended URLs (after in 2021 Google booted it from Chrome for being malware)

Posted by jpluimers on 2023/12/14

I was a long term user of “The Great Suspender”. It was a cool little Chrome Extension that would auto-suspend Chrome tabs that had not been used for a while and resume them when the tab did get accessed again thereby greatly reducing the horrible Chrome CPU and memory footprints.

During my year+ long treatment against metastasised rectum cancer I had suspended or hibernated most of my physical and virtual machines. So there was not just the surprised during the recovery of those that The Great Suspender had been kicked of the Chrome extensions, but also the problem of getting all the suspended tabs back of machines that eventually would be awoken out of sleep: I keep tabs open on stuff that I was working on or investigating for future blog posts, so these somehow could be important.

For now, I am not using anything as a replacement just to experience how well Chrome has evolved to suspend inactive tabs itself.

Now Chrome seems to do this well, as this post is based on an old VM that I have now unsuspended which had [Wayback/Archive] “the great suspender” “malware” – Google Search and the below links open in a mid-February 2021 state but not all archived in the Wayback Machine or Archive.is (some I did archived in February-May 2021).

The links are about why it got removed, how to recover lost suspended tabs and a possible alternative in case current Chrome suspend behaviour is not good enough.

Read the rest of this entry »

Posted in Bookmarklet, Chrome, Development, Google, HTML, JavaScript/ECMAScript, Power User, Scripting, Software Development, Web Development | Leave a Comment »

Need to write a bookmarklet that strips a Twitter URL down to the canonical form without s= and t= parameters (or maybe easier: no parameters at all)

Posted by jpluimers on 2023/12/12

Based on these tweets, I want to write a bookmarklet that at least removes the s= and t= parameters from Twitter URLs, maybe even all parameters (TODO: figure out if there are useful Twitter URL parameters first):

Even Jack Dorsey didn’t know they were introduced when he was still Twitter CEO. From the tweets below:

  1. The s parameter seems to have to have to do with both the kind of sharing and the type of client used.
  2. The t parameter could correlate with the user ID.

There is a sort of bookmarklet below which goes through an external web-site (search for “unfurl”), but I want to do it purely client-side.

Read the rest of this entry »

Posted in Bookmarklet, Development, JavaScript/ECMAScript, Power User, Scripting, SocialMedia, Software Development, Twitter, Web Browsers | Leave a Comment »

The Wayback Machine Chrome extension got a big update. Every journalist & researcher should install it ASAP! Faster URL archiving w/ customization, access to yr personal archive, and it tells you if the page you’re on has already been archived, etc.

Posted by jpluimers on 2023/12/05

Last year I learned about [Wayback/Archive] Wayback Machine – Chrome Web Store via a Twitter thread starting at

[Wayback/Archive] Craig Silverman on Twitter: “The Wayback Machine Chrome extension got a big update. Every journalist & researcher should install it ASAP! Faster URL archiving w/ customization, access to yr personal archive, and it tells you if the page you’re on has already been archived, etc. #osint”

I saved the full thread at [Wayback/Archive] Thread by @CraigSilverman on Thread Reader App:

Read the rest of this entry »

Posted in Bookmarklet, Chrome, Internet, InternetArchive, LifeHacker, OSINT - Open Source Intelligence, Power User, Uncategorized, WayBack machine, Web Browsers | Leave a Comment »

Chrome (likely also Firefox/Edge/Safari): no non-global way to workaround Bookmarklets failing on GitHub raw code with “Blocked script execution…”

Posted by jpluimers on 2023/10/18

Last year, I answered [Wayback/Archive] javascript – Bookmarklet to append a string to a URL – Stack Overflow (asked by [Wayback/Archive] Karlo Guidoni Martins, thanks!).

It is about not being able to run bookmarklets on pages hosted by for instance:

  • gist.githubusercontent.com
  • raw.githubusercontent.com

GitHub is an exception, as RAW files from these services do work fine:

At first sight, when running a Bookmarklet on those RAW GitHub served pages, you do not see an error: it just looks like the Bookmarklet does not work at all. The last part is right, but in the Chrome console you can actually see the error.

That error lead me to my answer:

Read the rest of this entry »

Posted in Bookmarklet, Chrome, Development, Firefox, JavaScript/ECMAScript, Power User, Scripting, Software Development, Web Browsers, Web Development | Leave a Comment »

Bookmarklet to navigate from a page to the most recent saved WayBack machine entry

Posted by jpluimers on 2023/10/04

A while ago, while writing last weeks post XPath based bookmarklets for Archive.is: more JavaScript fiddling!, I needed the most recent WayBack Machine archival of

https://developer.mozilla.org/en-US/docs/Web/XPath/Introduction_to_using_XPath_in_JavaScript

I vaguely remembered replacing the normal timestamp with a 3 and 13 zeros, so I tried this

https://web.archive.org/web/30000000000000/https://developer.mozilla.org/en-US/docs/Web/XPath/Introduction_to_using_XPath_in_JavaScript

And indeed, it did a HTTP 302 redirect to

https://web.archive.org/web/20220312161117/https://developer.mozilla.org/en-US/docs/Web/XPath/Introduction_to_using_XPath_in_JavaScript

So I quickly made this bookmarklet:

javascript:location.href='https://web.archive.org/web/30000000000000/'+document.location.href;

Then I created another one for getting the screenshot:

javascript:location=location.href.replace(/^https:\/\/web\.archive\.org\/save\/http/,'https://web.archive.org/web/30000000000000/http://web.archive.org/screenshot/http')

That works for screenshots archived with a Wayback Machine account, as these are related because of the inserted http://web.archive.org/screenshot/ fragment:

Since the Wayback Machine always looks for the closest savet timestamp, it does not matter the timestamps in these archived pages have a slight mismatch.

Memory lane

20231006: I edited this section referring two prior blog posts instead of one because of [Wayback/Archive] pbeccard: “@wiert @oliof You can also use…” – Mastodon (clearly showing that Mastodon like any social media platform does mangle backtick quoted code):

@wiert @oliof You can also use `javascript:location.href=’web.archive.org/web/*/’+docume to get the overview. I find this quite useful since I often want an older version of a page.

And later in the reply chain:

[Wayback/Archive] pbeccard: “@wiert @oliof Ah, I thought b…” – Mastodon

@wiert @oliof Ah, I thought by now that maybe Markdown is supported. I pulled the bookmarklet out of my bookmarklet bookmark folder. Here is a copy: https://gist.github.com/corppneq/d61e3…

[Wayback/Archive] Gist: Bookmarklets

I also found back two blog posts:

  1. Need to write a proper bookmarklet for the wayback archive (: mentioning many useful Wayback Machine JavaScript Bookmarklets from my gist [Wayback/Archive] Ideas/inspiration for writing a proper WayBack archive.org bookmarklet including this one:

    [Wayback/Archive] http://www.gyford.com/misc/wayback.html

      • WayBack:

        javascript:location.href='http://web.archive.org/web/*/'+document.location.href;
        

    I also archived this referred page: [Wayback/Archive] Bookmarklets.com – What’s New.

  2. JavaScript bookmarklet to replace part of the WayBack machine URL with a bookmarklet replacing

    JavaScript bookmarklet to replace part of the WayBack machine URL:

    A bookmarklet that goes to the latest rendered saved version (sometimes saved versions have not been rendered yet, so you get the latest available render):

    javascript:location=location.href.replace(/^https:\/\/web\.archive\.org\/save\/http/,'https://web.archive.org/web/30000000000000/http')

    The WayBack Machine uses a 14-position ID and tries to find the render that is the most close by. This is the format of the ID:

    yyyymmddhhmmss

    This is granular enough, as the WayBack machine only allows new saves that are usually 30+ minutes apart.

    (Note that period by now seems to be increased from 30+ minutes to 45+ minutes)

It also found back this post having the same huge number: 0.30000000000000004.com. How cool is WordPress search (:

–jeroen

Posted in Bookmarklet, Development, Internet, InternetArchive, JavaScript/ECMAScript, Power User, Scripting, Software Development, WayBack machine, Web Browsers | Leave a Comment »