My Friday night coding session yesterday ended up with Form Filler, a Python script to generate bookmarklets that automatically fill web forms. Handy for web development projects where you have to fill in the same form over and over again while developing and testing.
I've been writing them by hand until now but decided to build a system where you specify your form inputs in YAML and run the script and out comes a bookmarklet.
https://hamatti.org/posts/im-building-a-python-script-to-create-form-filling-bookmarklets/
#Firefox #Yandex #виброкодинг #ChatGPT #Tampermonkey
Навиброкодил связочку из #bookmarklet'а и #userscript'а, при помощи которых можно отправлять #YouTube-ролики прямо в https://300.ya.ru
Конечно, не совсем прямо, в сумме получается 4 клика (2, чтобы скопировать, 2 чтобы вставить). Но зато только мышкой.
1) Букмарклет
javascript:(async()=>{try{const text=await navigator.clipboard.readText();if(!text||!text.trim()){alert('Буфер пуст');return;}const w=window.open('about:blank','_blank');if(!w){alert('Popup заблокирован');return;}w.location.href='https://300.ya.ru/#'+encodeURIComponent(text);}catch(e){alert('Нет доступа к буферу');}})();
2) Юзерскрипт
// ==UserScript==
// @name 300.ya.ru Auto Paste via Hash (Stable)
// @namespace http://tampermonkey.net/
// @version 3.1
// @match https://300.ya.ru/*
// @run-at document-start
// ==/UserScript==
(function() {
'use strict';
const data = decodeURIComponent(location.hash.slice(1) || '');
if (!data) return;
let inserted = false;
let submitted = false;
function fireEvents(el) {
el.dispatchEvent(new Event('input', { bubbles: true }));
el.dispatchEvent(new Event('change', { bubbles: true }));
}
function insertOnce(el) {
if (inserted) return;
inserted = true;
el.focus();
const ok = document.execCommand('insertText', false, data);
if (!ok) {
const setter = Object.getOwnPropertyDescriptor(
HTMLTextAreaElement.prototype,
'value'
)?.set;
if (setter) setter.call(el, data);
else el.value = data;
}
fireEvents(el);
}
function tryRun() {
const textarea = document.querySelector('textarea');
if (!textarea || textarea.offsetParent === null) return;
insertOnce(textarea);
const btn = document.querySelector('button[type="submit"], .submit');
if (!submitted && btn && !btn.disabled) {
submitted = true;
observer.disconnect();
clearInterval(interval);
btn.click();
}
}
const observer = new MutationObserver(tryRun);
observer.observe(document.documentElement, {
childList: true,
subtree: true
});
const interval = setInterval(tryRun, 300);
})();
Копируем ссылку на YouTube-ролик, жмякаем букмарклет (2 клика, т.к. появится кнопка «Вставить» в целях безопасности). Откроется страничка Яши, и дальше уже всё само.
Mastodon boost/fav/reply #bookmarklet idea:
Add following bookmarklet, named eg. "boost/fav/reply" to your browser bookmark toolbar:
javascript:(function() {location='https://mastodon.social/search?q=' + location.toString();})()
Just change mastodon.social for your actual home instance, where you are logged in all the time. Eg. for me it is:
javascript:(function() {location='https://f.cz/search?q=' + location.toString();})()
If you are viewing original URL of ActivityPub status outside of your instance, which means, that you are not logged in and cannot boost, fav or reply, clicking on this bookmarklet will just open the same status "locally", where you are logged in.
Tested in #Firefox at least with #Mastodon and #Friendica statuses and it seems to work as intended. I used to copy+paste URL to my home instance search box, but this is single click solution.
I wonder if there is way for web site to offer you installing bookmarklet automagically (it would be probably insecure?)
Feedback welcome.

Hardware a software serveru f.cz spravují SPOJE.NET. Za obsah odpovídá moderátor Michael Polák. Zaměření je fšeobecné :-) Většinovým jazykem komunikace je čeština. Limit délky příspěvku je 2000 znaků.
Habs etwas erweitert: Kokain statt cocaine, hinzugefügt: 'künstlicher Intelligenz' und 'künstliche Intelligenz', ....
javascript:(function(){const rps={'LLM': 'Kokain', 'LLMs': 'Kokain', 'AI':'Kokain', 'die KI': 'das Kokain', 'KI':'Kokain', 'Cursor':'amphetamine', 'Claude Code': 'Kokain', 'Claude': 'Kokain', 'künstlicher Intelligenz': 'künstlichem Kokain', 'künstliche Intelligenz': 'künstliches Kokain'};const rpT=(node)=>{if(node.nodeType===Node.TEXT_NODE){let tx=node.textContent;for(const[oT,nT]of Object.entries(rps)){const regex=new RegExp(`\\b${oT}\\b`,'gi');tx=tx.replace(regex,nT)}node.textContent=tx}else if(node.tagName!=='SCRIPT'&&node.tagName!=='STYLE'){node.childNodes.forEach(rpT)}};rpT(document.body);})();
(Anleitung: Im Browser Bookmark/Lesezeichen erstellen. In das Feld Adresse den Code einfügen. Auf einer Webseite das Bookmark aufrufen.)
Weiteres cooles #Bookmarklet:
Youtube-Short in normales Youtube-Video umwandeln.
javascript:(()=>{const u=new URL(location.href);const m=u.pathname.match(/^\/shorts\/([^\/?]+)/);if(!m)return;location.href=`${u.origin}/watch?v=${encodeURIComponent(m[1])}`;})()
Props an Isotopp
https://infosec.exchange/@isotopp/116063685989644842
@[email protected] Turn https://www.youtube.com/shorts/code into https://youtube.com/watch?v=code: https://gist.github.com/isotopp/8f6e8c2a72e8b106b1f369a20ce399c2 ``` javascript:(()=>{const u=new URL(location.href);const m=u.pathname.match(/^\/shorts\/([^\/?]+)/);if(!m)return;location.href=`${u.origin}/watch?v=${encodeURIComponent(m[1])}`;})() ``` Thank you, ChatGPT. Who says that AI is useless. Open Firefox, Bookmarks, Manage Bookmarks, Add Bookmark, give name, add the javascript:... code to the URL. On a shorts video opening press the named JS Bookmark in the toolbar, get a proper watch URL started instead.
Make your browser smarter with bookmarklets
Browsers, in general, are applications that obtain web content from a web server (HTTP, HTTPS, and other supported protocols) that they connect to, whether it’s a static or a dynamic content. They are also packed with features that maximize your productivity when you’re surfing the web, and one of those features are bookmarks. Bookmarks are a list of your favorite websites that you may often access or that you may archive it for later use, and, depending on the browser, are synchronized across devices and are able to be categorized into groups.
However, browsers also support URLs that are not HTTP and HTTPS, and one of them is javascript:, which is necessary for bookmarklets. A bookmarklet is a one-line URL that contains the minified JavaScript code that works against documents, and it can modify contents of a document and send an alert. For example, javascript:alert("Hello world!") is a URL that tells JavaScript to execute the alert function. Executing this on your browser leads to this:
Before giving you the steps on how to add a bookmarklet, you’ll need to exercise caution. Bookmarklets are JavaScript code that is executed without warning, and this code might perform malicious and/or unwanted operations, such as exfiltrating data from your session.
Chromium browsers
To add a bookmarklet on your PC with Chrome, Chromium, and Chromium-based browsers, you can usually drag a bookmarlet to your bookmarks bar. Alternatively, follow these steps:
When you click on the bookmarklet, you should see:
Alternatively, you can search for the bookmarklet, and click on the bookmarklet, like below:
Firefox
To install a bookmarklet to your Firefox browser on your PC, you can drag the bookmarklet to the bookmarks bar. Additionally, you can manually add the bookmarklet by following the steps:
You should then see the below alert message:
Chrome for Android
To install a bookmarklet to Chrome on your Android phone or tablet, follow these steps:
Tap on the bookmarklet, not a search icon, and you should see this:
It works with simple and complicated bookmarklets. Once you’ve learned how to add a bookmarklet, why not try out some of the most interesting bookmarklets, such as this?
#Android #Bookmark #Bookmarklet #chrome #Firefox #Linux #news #Tech #Technology #update
How do you add a bookmarklet to your browser to make it smarter? It's simple!
#Bookmark #Bookmarklet #Chrome #Firefox #Computers #Laptops #Browsers #Browser #TechNews #TechUpdates #JavaScript
https://officialaptivi.wordpress.com/2026/01/13/make-your-browser-smarter-with-bookmarklets/
Commit 19: Heute haben wir ein Repo erstellt um unsere #39c3 Link-Sammlung zu einer #delightful Liste anzureichern. Was auf #github als #awesome bekannt ist.
Schaut mal beim #wartenAuf39c3 in das Repo rein. Vielleicht macht ja gemeinsames Bookmark sammeln mit dem #bookmarklet, #LocalStorage und verinfachtem #git Issue Erstellung einfach mehr Spaß?
Repo-Link: https://y.lab.nrw/jek25-19