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,861 other subscribers

Archive for the ‘JavaScript/ECMAScript’ Category

Publish your results through “wa11y.co: Wordle Accessibility” to allow visual impaired much easier and pleasant access to your results #a11y

Posted by jpluimers on 2024/03/19

I wish Wordle would be more accessible, but alas after all this time it still isn’t.

Luckily there is [Wayback/Archive] wa11y.co: Wordle Accessibility

At the end of your Wordle game, click “Share” to copy your result then paste it below to generate descriptive text.

It is open source on GitHub at [Wayback/Archive] cariad/wa11y.co: Makes Wordle results accessible. (most of it is written in JavaScript)

I first bumped into it via:

Read the rest of this entry »

Posted in accessibility (a11y), Development, JavaScript/ECMAScript, Scripting, Software Development, Web Development | Leave a Comment »

Oh boy, VB.NET and JavaScript both have a `with` keyword too!

Posted by jpluimers on 2024/03/05

Last year, within a week, I saw two tweets of languages that, like Pascal, have a with statement as well:

  1. [Archive.is] Shawn Wildermuth 💻☕🎸🎥🎮 on Twitter: “JavaScript’s Forgotten Keyword (with)”
  2. [Archive.is] John Kaster #BlackLivesMatter on Twitter: “@suited_aces @marcocantu @delphijunkie @JimMcKeeth @jpluimers I present “with”… “

The first points to an article that shows the JavaScript implementation of with is very similar to the Pascal one: [Wayback] JavaScript’s Forgotten Keyword (with) – DEV Community.

Just in case some of my readers do not know my opinion of the Pascal with statement  (it even has it’s own blog category), I really think you should not use it Delphi: you should avoid the with statement as it makes your code less future proof.

The reason not to use it is called [Wayback] Accidental Shadowing in computer language speak (it also can rear its head when you define variables at different block levels like for instance this golang example: [Wayback] Warning for accidental variable shadowing with block scope – Technical Discussion – Go Forum).

Even the JavaScript specification advises against using the with keyword in [Wayback] with – JavaScript | MDN

**Warning:**Use of the with statement is not recommended, as it may be the source of confusing bugs and compatibility issues. See the “Ambiguity Contra” paragraph in the “Description” section below for details.

There have been various proposals to extend the Delphi implementation of the with statement to make it more resilient to Accidental Shadowing by forcing the usage to be prepended by a . (dot) or alias, as for instance seen in [Wayback] Re: “with” Coders are Monsters – delphi / [Wayback] delphi • View topic • “with” Coders are Monsters:

This is in fact what the second twitter messages pointed to: a VB.NET example doing just that: prepend with a dot: [Wayback] Maarten Balliauw on Twitter: “Looks like using With makes it pretty clean!… “

I was not even aware that VB.NET had it, but it has: [Wayback] With…End With Statement – Visual Basic | Microsoft Docs

And it has similar debugging issues as with Delphi as per [Wayback] The VB.NET ‘With’ Statement – embrace or avoid? – Stack Overflow:

Find the beginning of a With statement and set a breakpoint. Step to the next line (so you’re hiding the first line right under the if block). Highlight it, then ‘Add Watch’. You should see this: ‘With’ contexts and statements are not valid in debug windows.

–jeroen

Posted in .NET, Delphi, Development, Go (golang), JavaScript/ECMAScript, Pascal, Scripting, Software Development, VB.NET, With statement | Leave a Comment »

Walls and Ladders when pasting e-mail on account sign-up forms: Paste It – Chrome Web Store

Posted by jpluimers on 2024/02/06

In a game of Walls and Ladders (similar to Arms Race), the Ladders usually win, see the references at the end of the post.

The actual “game” in this case is more and more sites trying to build walls prevent pasting credential related information like user IDs (often e-mail addresses) or passwords often citing “more safety” or “less security risks”, and users get taller ladders wanting to do just that because of their own security concerns:

[Wayback/Archive] Stef 🎈 on Twitter: “Dear mobile/web-apps, please never never disable copy and paste “due to security reasons”. -everybody with a password manager.”

The walls will always loose so it is better to invest the money for the walls into other security measures.

Given that most of the risks are web-sites getting that information exfiltrated, I wish they put more energy into bolting down that side of the security risk side than the hampering legitimate users entering that information in the first place.

Since so many of these sites have leaked my information in the past, any email address I use for activating an account is like 50 characters long. Something I am not going to type once (because of typing mistakes) and definitely not twice (to confirm I did not make typing mistakes).

Read the rest of this entry »

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

A great source to learn about JavaScript element enumeration and modification: iamadamdev/bypass-paywalls-chrome

Posted by jpluimers on 2023/12/19

Sometimes one bumps into a Google Chrome extension that is both useful from a practical perspective as insightful on learning from how it is done.

This is one: [Wayback/Archive] iamadamdev/bypass-paywalls-chrome: Bypass Paywalls web browser extension for Chrome and Firefox.

It supports many sites (including more than a dozen Dutch ones) for which it is not easy to justify creating separate accounts for them (just the risk of them leaked into Have I been Pwned? is large, despite GDPR) and staying logged on for each of them. I have dozens of listings of my email addresses at haveibeenpwned.com, so I am a lot more careful making accounts than in the past despite assigning unique email addresses for each account (which is part of the burden).

Read the rest of this entry »

Posted in Chrome, Development, HTML, 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 »

Need to find a better way to log the essentials of a browser side HTML element using JavaScript object

Posted by jpluimers on 2023/12/04

The basic options for logging an HTML Element using JavaScript are for instance described in [Wayback/Archive] google chrome – How can I log an HTML element as a JavaScript object? – Stack Overflow (thanks [Wayback/Archive] Ben Flynn for asking and [Wayback/Archive] Mathias Bynens for answering)):

Use console.dir:
var element = document.documentElement; // or any other element
console.log(element); // logs the expandable <html>…</html>
console.dir(element); // logs the element’s properties and values

Both log all html or all properties even though often these are enough (most via [Wayback/Archive] Element – Web APIs | MDN):

Read the rest of this entry »

Posted in Development, HTML, HTML5, JavaScript/ECMAScript, Scripting, Software Development, Web Development | Leave a Comment »

Destructuring assignment – JavaScript | MDN

Posted by jpluimers on 2023/11/29

Since I didn’t know that JavaScript could deconstruct (a superset of Parallel Assignment) [Wayback/Archive] Destructuring assignment – JavaScript | MDN of which I copied the topmost examples (there are far more in the rest of the article):

Read the rest of this entry »

Posted in Development, JavaScript/ECMAScript, Scripting, Software Development | Leave a Comment »

javascript – Chrome debugging – break on next click event – Stack Overflow

Posted by jpluimers on 2023/11/23

I wish I had known this ages ago: [Wayback/Archive] javascript – Chrome debugging – break on next click event – Stack Overflow (thanks [Wayback/Archive] D.R. for asking and [Wayback/Archive] Konrad Dzwinel for answering):

What you are looking for are [Wayback/Archive] ‘Event Listener Breakpoints‘ on the Sources tab. These breakpoints are triggered whenever any event listener, that listens for chosen event, is fired. You will find them in the Sources tab. In your case, expand ‘Mouse’ category and choose ‘Click’.

Read the rest of this entry »

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

Trying to do my best to be “and” instead if “either, or” (plus some links to convert Instagram media id to/from shortcode)

Posted by jpluimers on 2023/11/15

[Wayback/Archive] Danielle Braun dr. on Twitter: “En en in plaats van of of.”

The image is by @thepresentpsychologist on Instagram (figured that out via Google Lens finding [Wayback/Archive] Psychological Safety Newsletter #39: Diversity and Ethical Behaviour | Psychological Safety), but and it took some effort to find the original post back as Instagram does not allow anonymous browsing.

Read the rest of this entry »

Posted in About, Autistic Spectrum/Autism, Development, Instagram, JavaScript/ECMAScript, Node.js, Personal, Scripting, SocialMedia, Software Development, Web Development | Leave a Comment »