Become a fan of Slashdot on Facebook


Forgot your password?

Comment All your data r belong to us! (Score 3, Informative) 257 257

As another noted on the Red Site:

"We'll know everything* about you and we'll be snitching (including your BitLocker key) whenever and/or to anyone we think is in our interest to. Starting Aug 15"[1]

In particular, this is more than a little disturbing.

"But Microsoftâ(TM)s updated privacy policy is not only bad news for privacy. Your free speech rights can also be violated on an ad hoc basis as the company warns:

In particular, âoeWe will access, disclose and preserve personal data, including your content (such as the content of your emails, other private communications or files in private folders), when we have a good faith belief that doing so is necessary toâ, for example, âoeprotect their customersâ or âoeenforce the terms governing
the use of the servicesâ."

As with all things Microsoft, use at your own risk. Only now, the risks to you personally are higher than ever before.


Comment Re:User scripts FTW (Score 1) 6 6

My point was just those features make quickie editing even quicker - your Amazon script is

var el = document.querySelector('#summaryStars, .totalReviewCount'), total = parseInt(el && el.textContent)

if (total) {
    Array.from(document.querySelectorAll('#histogramTable td:last-child a')), a => {
            var num = parseInt(a.textContent), pct = 100 * (num / total)
            a.innerHTML = `${num} - <b>${pct.toFixed(0)}%</b>`

and about two dozen of my scripts are variations on this :) Put the basic framework in the new script template and you just need to fill in a selector and what to do with each element...

There are a lot of annoying websites out there lol, hope this comes in handy next time one just needs that little fix... ;)

Comment User scripts FTW (Score 1) 6 6

I write a lot of user scripts and couldn't live without being able to tweak websites to add features, or more often, fix their problems - I just checked Tampermonkey and I've currently got 40 user scripts for various sites :)

There are a lot faster ways to write them now using features from HTML5 and now ES6 which weren't there even a year ago - for instance, your password script can be rewritten in one line

Array.from(document.querySelectorAll('input[type=password][autocomplete=off]')).forEach(elem => { elem.autocomplete = 'on' })

using arrow functions, Array.from and querySelectorAll .

If you use Chrome this currently only works in the development version, so for the next few months until that's released you can write

[]'input[type=password][autocomplete=off]')).forEach(function(elem) { elem.autocomplete = 'on' })


If instead you want to insert HTML, using template strings and insertAdjacentHTML again make life easier, e.g.

Array.from(document.querySelectorAll('a[href$=".jpg"]')).forEach(a => { a.insertAdjacentHTML('afterbegin', `<img src="${a.href}" style="width: 32px; height: 32px; margin-right: 0.5em">`) })

matches links with targets ending in .jpg, then prepends a 32x32 pixel sized copy of the linked image to each!

About 90% of user scripts are just

find things -> loop over them -> adjust properties and/or edit HTML

so it's handy having simpler ways of writing it :) Hope that was helpful, I keep meaning to write an article on advanced techniques for writing user scripts and not doing it...

Comment Re:A more complete summary of the situation (Score 2) 581 581

The CEO states that "Neither Alexis nor I created reddit to be a bastion of free speech, but rather as a place where open and honest discussion can happen."

Wow! Steve's gonna want some Tylenol after all the cognitive dissonance!

Yup! Double-plus ungood.

"Pok pok pok, P'kok!" -- Superchicken