« first day (4493 days earlier)      last day (672 days later) » 

10:32
does anyone here know of a chrome/firefox extension (or even userscript) that create a resizable rectangle, and get the links inside that area?
the closest thing I found was this: addons.mozilla.org/en-US/firefox/addon/snaplinksplus but that only open the links to tabs hmm
 
3 hours later…
13:46
@NordineLotfi No, I've not heard of such a thing. I can see why one might want it but I think in general it's not really needed by many.
Can definitely help to cite stuff, I guess. Or just grab some links from one part of the page.
@Jefferson Make it () => RemoveRow(parseInt(index))
14:05
hmm, I guess I might as well try and see if I could hack something that does this. Making a rectangle on a live web page isn't too hard, getting all of the links from a page isn't either, but the main thing I would probably get stuck on would be the "get only the links inside the area of the rectangle" part
will see if I can make an MRE and come back here :)
Yeah, I think the "get only the links inside the area of the rectangle" is going to be quite annoying.
As a suggestion - consider finding all links in marked text. It's not a rectangle but should be easier to implement.
Also, when you say "a rectangle" should that cover multiple unrelated HTML elements? Because if not - if all the links can be traced to one common ancestor, that might be even easier to implement. You can do node.querySelectorAll("a") to grab them in that case.
As in, use the DOM tree as leverage, if possible, rather than try and figure out where items lay on the rendered output.
that's some good pointers. Thank you :D
Comes with years of experience of being lazy.
I know what you mean by that, but I wouldn't call that being lazy :P if you truly were lazy, you wouldn't bother remembering or knowing any of this. You might even not want to use Javascript, etc
Fun fact, I really only got into JS because I was lazy. I'm at least half serious. During uni, I'd some times I'd need to figure out how some more abstract code would work and I'd just write it in the browser console. Like a loop or some condition. The language didn't matter and writing it in Java (which was my main language at the time) would have taken too much time. Boot up Eclipse, start a new project, just to write a simple loop, for example.
14:22
I'd call that being efficient, if anything. If you know X but don't want to use X, Y, Z, then using one, regardless of it's cons, as long as it helps you do W, is totally not being lazy. You're working around your goals/problems.
In not very related news, if this is the payload you send over HTTP, wouldn't it be...like insecure? I've not tried to tamper with it but looks not great at first glance:
query fetchLibraryArtists($offset: Int = 0, $limit: Int = 50)
{
    me
    {
        library
        {
            artists(offset: $offset, limit: $limit)
            {
                ...on UserLibraryArtistPage
                {
                    __typename pagingInfo
                    {
                        offset limit
                    }
                    items
                    {
                        ...on UserLibraryArtistResponse
                        {
                            __typename addedAt
I don't know what it's written in. It's what Spotify seems to send as a parameter to the backend.
(note: I've formatted it, it was a single line otherwise)
I don't know, but it does look weird. This reminds me of the stuff youtube loads as minified js on some pages.
They probably tampered with Javascript and overwrote some stuff, like the trick with overwriting console.log we talked about once
if not that, maybe it's a custom data structure/dict/json?
@VLAZ you mean like this
 div.querySelector('span').onclick() = `RemoveRow(${parseInt(index)})`;
@Jefferson .onclick = () => RemoveRow(parseInt(index))`
it like it never update that data
I still see the old link
this work fine before it
14:34
@NordineLotfi I'd bet it's a custom data structure. See the video Fantastic ASTs and where to find them. The talk is by phenomnomnominal who 1. occasionally shows up here 2. works or worked at Spotify. Won't be surprised Spotify adopted a custom data scheme that gets AST transformed into something.
div.querySelector('span').id = spanrowItem_${index};
should I try something like this
        div.querySelector('span')
            .id = `spanrowItem_${index}`
            .onclick = () => RemoveRow(parseInt(index));
@VLAZ Interesting :o I wouldn't have thought about AST being used here
it does make more sense if that's what they're doing
Like, it might also be an existing language. Don't know. Just know that it looks like a structured query. And I know a person who is fond of writing internal tools who did work at Spotify.
@VLAZ you can see the when you remove row 1 it is not updating the span onclick
14:55
@Jefferson What is supposed to be happening here if everything worked? Just remove the row? Or do more stuff?
It should remove the row then renumber all the other items
because I need there to always be a row 1
if they remove row 1 then the next time it is open there will be no form-group
Like, probably can be made better. But it's not going to be much harder.
I still don't get the numbering thing.
15:17
thanks I will try this
16:06
I am trying to implement some idea ,like that when any user visit any website ,browser store it into history and user can have necessity to search same thing again that is stored in history.In this case, he/she can go to history and copy it but as i am lazy developer i want to get this functionality as extension on top of the browser. Is there any solution like that?
@Chunk Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
1 hour later…
17:26
@Jefferson If you are writing HTML then the contents inside of quotes of an known event are considered code
so <button onclick="removeRow(1)" >Remove</button> would work
if you are inside of a JavaScript block then anything you put inside quotes becomes a string
var results = "removeRow()"; // string
var results = "alert('test')"; // string "alert('test')"
var results = alert('hello world'); // the alert function is called and an alert is shown
the backtick quotes will allow you to put embed code inside of your quotes but that code must be enclosed inside tokens and it still returns a string
Example
var x = 10;
var string = `The value of x is ${x}`; // string "The value of x is 10"
@Chunk You can use cookies
 document.cookie = "search=dogs";
 console.log(document.cookie); // search=dogs
18:00
@VLAZ that looks like GraphQL
specifically, the structure, the query and __typename keywords

« first day (4493 days earlier)      last day (672 days later) »