/r/javascript

Photograph via //r/javascript

Chat about javascript and javascript related projects. Yes, typescript counts. Please keep self promotion to a minimum/reasonable level.

All about the JavaScript programming language.

Subreddit Guidelines


Specifications:


Resources:


Related Subreddits:

r/LearnJavascript

r/node

r/typescript

r/reactjs

r/webdev

r/WebdevTutorials

r/frontend

r/webgl

r/threejs

r/jquery

r/remotejs

r/forhire


/r/javascript

2,382,566 Subscribers

0

[AskJS] eslint, beautiful but IMHO being misguided. How do I get off?

I've been a long time user of eslint and mostly it 'just works' so don't think about it much.

Recently I started a new project and decided to install the latest eslint and got slammed hard by the 9.0 release.

WTF. I HATE the new configuration file mess. IMHO config files want to be declarative and so .eslintrc.json works perfect.

This new format looks to be taking a step back and taking queues from webpack of all things.

I almost can't believe that such a critical tool would suddenly on a whim decide to change such a core part of itself and not maintain backwards compat. Totally shakes my confidence.

Anyway so I started searching around for what is going on and found https://github.com/eslint/eslint/discussions/16557 which is what I'm assuming 9.0 is. In particular not a fan of any JS dev for such a critical project seemingly not 'getting' the importance of TS, especially for a project like eslint of all things.

TLDR; eslint has no substitute but I must scream! The beauty of OS is that when this sort of thing happens new projects tend to spring up. Currently I don't see that and am wondering if I am missing something in the eslint discussion?

3 Comments
2024/04/12
22:26 UTC

0

[AskJS] JavaScript operators like or ( || ), and ( && ), null coalescing ( ?? ) makes weak comparasion?

I've recently had a couple of bugs using || instead ??, and I have a question about what kind of comparision these operators do.

5 Comments
2024/04/12
21:11 UTC

0

[AskJS] unpkg.com down?

https://unpkg.com/status/ & trying to load some scripts from unpkg.com like https://unpkg.com/fullpage.js/dist/fullpage.extensions.min.js & https://unpkg.com/fullpage.js/dist/fullpage.min.css both showing a cloudflare error page.

5 Comments
2024/04/12
08:38 UTC

7

[AskJS] what even is the point of cors

So I understand what it is and what it does but not why it exists.

So if we require the origin to be same site yes it blocks a malicious site from just making requests with the cookies but then what if we introduce a proxy?

We pass the cookies to the proxy and the proxy passes it to the API.

Then you make it a same site cookies to not allow other sites to use it. Malicious site can no longer access the cookie without hacking your browser and send to the proxy but now since the cookie basically restricts the origin because no other origin can use it what's the point of still having cors if the cookie does its purpose plus more(protect against proxy)?

It just feels redundant to me but I must be missing something otherwise it wouldnt be a thing

21 Comments
2024/04/11
11:21 UTC

1

[AskJS] How to inspect network calls

Hey guys recently in an interview i was asked how can i view the live data calls being made to backend from website. I was allowed to use any tool i wish for inspection including network tab. The site that gave was some crypto charts site which i had never seen or worked with in past. But I was unable to figure out how to inspect network calls or read response being sent by server. I am attaching the site below too. Could you please guide how its done or if it is even possible?
https://www.dextools.io/app/en/pairs

1 Comment
2024/04/11
11:12 UTC

7

Which framework (frontend) do you use?

Please leave comments as to why you like it or if I missed any interesting frameworks (there is limit of 6 options only). I'm running this poll to better understand positives and negatives of each (from a practical perspective)

View Poll

70 Comments
2024/04/11
09:23 UTC

7

[AskJS] How to sandbox a plugin within a website

I am working on a website something similar to Facebook application platform from 2009-10.

It basically allow users to install mini apps from app repository and use their features within the site. The mini apps can be like trello, confluence, etc.

I want to ask on how to isolate these apps on the site. I've read about web workers but since each app will have a fully-interactive UI, will it be feasible to use them? cosnidering their memory limitations and all. Iframe can also be a good choice but they are hard to manage and UI may go off track.

Considering at a time only one app will be active but I also want to preserve state of previously active apps so that they can instantly spwan instant for fresh bootup, can this be possible?

9 Comments
2024/04/10
21:48 UTC

7

[AskJS] How best to manage a GitHub project?

Hi,

I recently open-sourced a JavaScript framework I created for personal projects: https://github.com/markersunny/eventiveness. I am not quite experienced in this, but I am committed to maintaining the project in the best way possible. I am hoping for tips and advice on things I need to set up and what to watch out for, I am most interested in the community aspects because having helpful people on the team will make my life so much easier. I will appreciate every tip though.

Thanks guys.

27 Comments
2024/04/10
17:23 UTC

4

[AskJS] Debug and overwrite Js function

Hello, I'm making a Wordpress website using this theme: https://montagne.qodeinteractive.com/ If you click on the top right icon it will open a black drawer from the right, but if you scroll the page the drawer will close on its own. I'm trying to find and overwrite the function because I need it to stay open, but I can only find a jquery function with generic variable names. Can I get some help? Will delcare empty functions be enough to stop the behavior? Thanks

1 Comment
2024/04/10
12:19 UTC

3

WTF Wednesday (April 10, 2024)

Post a link to a GitHub repo or another code chunk that you would like to have reviewed, and brace yourself for the comments!

Whether you're a junior wanting your code sharpened or a senior interested in giving some feedback and have some time to spare to review someone's code, here's where it's happening.

Named after this comic

2 Comments
2024/04/10
07:00 UTC

5

[AskJS] Is it possible to fill a pdf form using JavaScript?

Hi.

I’m trying to create a better workflow, to save me time. Client side fills in an interactive form (JotForm), and that information needs to be populated to a government pdf form (we’re not a government agency + boss has given me the go ahead if I can solve this) . Many of the form fields at my work are repetitive but necessary and can’t be changed. ie Last name, first name, signature etc. And I fill these manually. It’s about 50 pages for each client.

Is there a way to create an automatic populating JavaScript from the form? I don’t have a tech team at my job, and I’m not too tech savvy.

6 Comments
2024/04/09
22:49 UTC

10

[AskJS] How do I make keypresses register continuously instantly, without an initial delay?

When you press a key, it, of course, presses the key, but then pauses for a brief time before continuously holding this key to stop accidental multiple key presses, like ttttthhhhiiiiiissss. However, how can I bypass this when writing a tampermonkey script, so that it starts being a continuous press from the moment I press it? Thanks.

6 Comments
2024/04/09
00:10 UTC

7

[AskJS] Chrome extension to isolate tabs.

Hello, I'm new here, so thank you to everybody who will take the time to help me.

I started learning JavaScript a few months ago and already had some coding experience before. However, I have a new project, which is to create a Chrome Extension capable of isolating tabs.

This project is part of a larger project involving Selenium. To achieve my goal, I need to develop this extension, but I'm not quite sure how to proceed.

When I talk about "isolating" tabs, I mean that I need to :

  • Log in to two different accounts in two different

-Set a different proxy for each tab.

I believe this is possible since extensions like SessionBox already accomplish similar tasks. However, the main challenge with SessionBox is communicating with Selenium, which is difficult (and I'm not even sure if it's possible).

I'm unsure where to start with creating this project. The Chrome API doesn't seem to offer this kind of option. Therefore, I'm open to any suggestions. Thanks to everyone who will try to assist me!

16 Comments
2024/04/08
21:27 UTC

Back To Top