devtools-detect
devtools-detect | proposal-slice-notation | |
---|---|---|
8 | 2 | |
2,006 | 518 | |
- | 0.4% | |
4.7 | 0.0 | |
8 days ago | 5 months ago | |
HTML | HTML | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
devtools-detect
-
Website just displays "Unwanted Dev Tools Console detected "
For me it's "Sorry,, You can not view this website when JaveScript is disabled, Thank you" I have JavaScript enabled. Looking at the website's HTML source code a lot of logic seems (bad) copy&pasted from other wordpress plugins. For example there's logic that disables right-click, too.
> import devtools from 'https://www.dinbyggare.se/wp-content/plugins/wccp-pro/index....
That's version 2.1 of https://github.com/sindresorhus/devtools-detect Meanwhile version 4 was released and even the maintainer writes "This package has a lot of flaws. It used to work better, but browsers changed, and the detection now has too many false-positives."
-
Resizing works in the browser, but doesn't work when 'Inspecting' (more in comments)
My boss has been nagging my co-worker to fix the same issue. Not sure he's attempted implementing it yet, but I recently sent this to my co-worker, so that he can hopefully implement custom code when DevTools are open. https://github.com/sindresorhus/devtools-detect
-
MailChimp blacklists your IP if you open the browser's dev tools
Looking at the code[0], it just defines an aspect ratio threshold for your browser's viewport and triggers if it's outside of that on width or height. So when you open a second panel, your viewport goes back to being closer to 16:9/16:10 and the tool considers that within both thresholds.
The detection is hilariously primitive and entirely unreliable.
[0]: https://github.com/sindresorhus/devtools-detect/blob/main/in...
-
Can we prevent the users of our website from accessing web dev tools (of any browser) while they are on our site?
they even imported a 4 year old package to handle devtools detection: https://github.com/sindresorhus/devtools-detect
- Copy text from the websites which don't allow
-
JavaScript Is Weird
Devtools can actually be detected to a certain extent - https://github.com/sindresorhus/devtools-detect
proposal-slice-notation
-
HypeScript: Simplified TypeScript's type system in TypeScript's own type system
> Switch statements
JS has had switch statements for a long time. Do you mean switch "expressions" that can be used inline? It's not pretty but JS has long supported that too using either eval() "hacks" or IIFEs: https://stackoverflow.com/questions/32451049/is-eval-the-onl...
Do you mean pattern matching? There are two Stage 1 TC39 proposals with different approaches to it:
More hands-on/direct: https://github.com/tc39/proposal-pattern-matching
More indirect: https://github.com/tc39/proposal-do-expressions
> list comprehensions
There are several libraries with strong Iterator support today that while not syntactically gorgeous do great jobs at allowing you to write simple list operations. Off the top of my head are IxJS and iter-tools, but also classic mainstays like up to date versions of lodash and Ramda.
There's a Stage 2 proposal to bring more of them into "the standard library": https://github.com/tc39/proposal-iterator-helpers
There's also a Stage 2 proposal for an operator to make the syntax generally nicer no matter the library: https://github.com/tc39/proposal-pipeline-operator
> array slicing
Array.prototype.slice() was added back in ES2015: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
Array.prototype.at() was "just added" in ES2022 for unary "slice" (ability to use negative indexes): https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
If you prefer syntax to function calls, there's a Stage 1 proposal still live for that: https://github.com/tc39/proposal-slice-notation
> better equality operators
That ship has probably sailed. Most projects at this point just have linter rules to standardize everything to the more reliable "triple equals" (===, and !==).
There are proposals for more structural equality functions in the standard library, though, for instance: https://github.com/tc39/proposal-array-equality
-
JavaScript Is Weird
Both are stage 1 proposals that I hope get in there some day.
https://github.com/tc39/proposal-slice-notation
https://github.com/tc39/proposal-pattern-matching
What are some alternatives?
V7 - Embedded JavaScript engine for C/C++
Super-Template-Tetris - Tetris as a C++ Template Metaprogram
proposal-pattern-matching - Pattern matching syntax for ECMAScript
eslint-config-standard - ESLint Config for JavaScript Standard Style
proposal-array-equality - Determining Array Equality
decimal.js - An arbitrary-precision Decimal type for JavaScript
coffeescript - Unfancy JavaScript
openvsx - An open-source registry for VS Code extensions
proposal-do-expressions - Proposal for `do` expressions
oni2 - Native, lightweight modal code editor