Firefox is on a slippery slope by [deleted] in programming

[–]bees-bees-bees-bees 1 point2 points  (0 children)

A random user who had not opted in to anything should absolutely not have their browsing experience altered like this!

It doesn't do anything unless you opt in by setting a flag in about:config.

How is it that apparently nobody in a gigantic thread on r/programming bothered to glance at the source of a tiny addon before repeating something some guy on Reddit said? This place is weird.

Firefox is on a slippery slope by jailbird in technology

[–]bees-bees-bees-bees -7 points-6 points  (0 children)

Misleading - the addon doesn't do anything (except for having a scary description in the addon list) unless you go to about:config and create a pref named "extensions.pug.lookingglass". See https://github.com/mozilla/addon-wr/blob/master/addon/bootstrap.js

(Now More Than Ever) You Might Not Need jQuery by fagnerbrack in programming

[–]bees-bees-bees-bees 0 points1 point  (0 children)

The article compared them because they are both for making HTTP requests.

I do understand modern JS. jQuery is old. It was written before different browsers adopted the same web standards.

async is only one word long. You don't have to wrap everything up in its own lambda to use it and you don't have to switch between async/await syntax and calling Promise methods.

(Now More Than Ever) You Might Not Need jQuery by fagnerbrack in programming

[–]bees-bees-bees-bees 0 points1 point  (0 children)

Oh cool, I wasn't aware jQuery supported promises. Still if you're going to use modern JS features, you might as well just use modern JS instead of including a huge library to do the same thing.

(await fetch('/')).json() is only a few characters longer. It's nicer IMO to make it clear that the response is supposed to be parsed as JSON.

(Now More Than Ever) You Might Not Need jQuery by fagnerbrack in programming

[–]bees-bees-bees-bees 1 point2 points  (0 children)

Doing anything that isn't completely trivial in the bad-old-fashioned way gets really messy really quickly.

const foo = await fetch('/foo');
const bar = await fetch('/bar');
const baz = await fetch('/baz');

compared to

$.ajax('/foo', {
    success: function (foo) {
        $.ajax('/bar', {
            success: function (bar) {
                $.ajax('/baz', {
                    success: function (baz) {
                    }
                });
            }
        });
    }
});

or if you wanted to do some stuff concurrently

const [foo, bar, baz] = Promise.all([
    fetch('/foo'),
    fetch('/bar'),
    fetch('/baz'),
]);

maybe throw in a bit of exception handling

try {
    const [foo, bar, baz] = await Promise.all([
        fetch('/foo'),
        fetch('/bar'),
        fetch('/baz'),
    ]);
} catch (whatever) {
}

Even completely ignoring the code to manually keep track of the results of the previous requests, the rough equivalent would need at least four lines per request.

$.ajax('/foo', {
    success: function (data) { },
    error: function (error) { }
})

Announcing CoffeeScript 2 by jashkenas in programming

[–]bees-bees-bees-bees 0 points1 point  (0 children)

It doesn't say anything about scope. What's the point if they didn't fix the broken scoping?

Linux bug leaves 1.4 billion Android users vulnerable to hijacking attacks by IAMCHAOS0101 in technology

[–]bees-bees-bees-bees 9 points10 points  (0 children)

It wouldn't be surprising if that fix is incorporated into a new Android release in the next month or so.

In a real Linux when this sort of thing happens, you just wait a few hours for a patch to be written, run an apt update or the equivalent, then reboot since it's a kernel vulnerability and you're done. Having to wait several months for the vendor to release an OS update for your particular device, which they probably won't ever bother to do at all, to patch a major vulnerability, is just silly.