Search

Nalezeno "javascript": 268

How to Inject a Global with Web Extensions in Manifest V3


For those of you not familiar with the world of web extension development, a storm is brewing with Chrome. Google will stop support for manifest version 2, which is what the vast majority of web extensions use. Manifest version 3 sees many changes but the largest change is moving from persistent...

How to Get Extension Manifest Information


Working on a web extension can be kinda wild — on one side you’re essentially just coding a website, on the other side you’re limited to what the browser says you can do in the extension execution environment. One change in that environment is coming January 2023 — pushing...

Get a Random Array Item with JavaScript


JavaScript Arrays are probably my favorite primitive in JavaScript. You can do all sorts of awesome things with arrays: get unique values, clone them, empty them, etc. What about getting a random value from an array? To get a random item from an array, you can employ Math.random: const arr =...

Legacy String Methods for Generating HTML


I’m always really excited to see new methods on JavaScript primitives. These additions are acknowledgement that the language needs to evolve and that we’re doing exciting new things. That being said, I somehow just discovered some legacy String methods that you probably shouldn’t...

Interview with an Intiface Haptics Engineer


I was recently re-reading my Interview with a PornHub Web Developer and one bit I started thinking about was the VR question and the idea of making users not just see but feel` something. The haptic feedback of VR games is what really sets them apart from your standard PC or console game. So when...

Input valueAsNumber


Every once in a while I learn about a JavaScript property that I wish I had known about years earlier — valueAsNumber is one of them. The valueAsNumber provides the value of an input[type=number] as a Number type, instead of the traditional string representation when you get the value:...

#posobota 26.3. 2022 – less – offline@Praha


Ahoj, tak na tohle jsem se dlouho těšil. Napsat zprávu, že po dlouhé době se opět můžeme potkat naživo, offline. Tentokráte v Praze v kancelářích manGowebu – Jungmannova 34, Praha 1. Přednášek kratších…

Detect Dark Mode Preference with JavaScript


Seemingly every website, dapp, and app offers a dark mode preference, and thank goodness. Dark mode is especially useful when I’m doing late night coding, or even worse, trading into altcoins. I’m presently working on implementing a dark theme on MetaMask and it got me to thinking:...

Píšeme hru Wordle v Elmu


O Elm už vyšlo na Zdrojáku několik tutoriálů. Dnes si ukážeme vytvoření aplikace. Konkrétně do Elm přepíšeme populární hru Wordle

Comparing Node JavaScript to JavaScript in the Browser


Being able to understand Node continues to be an important skill if you’re a front-end developer. Deno has arrived as another way to run JavaScript outside the browser, but the huge ecosystem of tools and software built with Node mean … Comparing Node JavaScript to JavaScript in the Browser...

9 New React and JavaScript Links for February 2022


Every now and then, I find that I’ve accumulated a bunch of links about various things I find interesting. Like React and JavaScript! Here’s a list of nine links to other articles about them that I’ve been saving up and … 9 New React and JavaScript Links for February 2022 originally...

JavaScript Class Privates


One of my aspects of JavaScript that drew me to it as a young developers was that its syntax was loose and I could code quickly. As you gain experience as an engineer, you start to realize that some traditional coding structure is a good thing, even if it slows you down. Using Jest or […] The...

How to Cycle Through Classes on an HTML Element


Say you have three HTML classes, and a DOM element should only have one of them at a time: <div class="state-1"</div<div class="state-2"</div<div class="state-3"</div Now your job is to rotate them. That is, cycle through classes … How to Cycle Through Classes on...

Immediately Executing setInterval with JavaScript


Employing setInterval for condition polling has really been useful over the years. Whether polling on the client or server sides, being reactive to specific conditions helps to improve user experience. One task I recently needed to complete required that my setInterval immediately execute and then...

JavaScript S


Replacing a substring of text within a larger string has always been misleading in JavaScript. I wrote Replace All Occurrences of a String in JavaScript years ago and it’s still one of my most read articles. The confusion lies in that replace only replaces the first occurrence of a substring...

navigator.clipboard API


Reading from and writing to the user’s clipboard can be both a very useful and dangerous capability. Used correctly and it’s a huge convenience to the user; used dubiously and the user could suffer catastrophic consequences. Imagine a wrong account number or wallet address being copied...

The Invisible JavaScript Backdoor


An interesting (scary) trick of an nearly undetectable exploit. Wolfgang Ettlinger: What if a backdoor literally cannot be seen and thus evades detection even from thorough code reviews? I’ll post the screenshot of the exploit from the post with the …

Array.prototype.at


Working with arrays is an essential skill in any programming language, especially JavaScript, as we continue to rely on external data APIs. JavaScript has added methods like find and `findIndex recently, but one syntax I love from languages like Python is retrieving values by negative indexes. When...

Nahoru
Tento web používá k poskytování služeb a analýze návštěvnosti soubory cookie. Používáním tohoto webu s tímto souhlasíte. Další informace