how to run a code on Chrome DEVTools

I have this very specific scenario on my job where I need to keep refreshing a certain page in my work so it can update new IDs. I thought about making a code that would refresh the page every 5 seconds and only stop when it finds a different ID from the ones already stored. The problem with this approach is: Every time I run a code, like location.reload(), obviously the page refreshs and both the data and code are lost. How would this be possible? I thought about using some external file to do that, like VBA libreoffice or even a notepad (we can't download anything), but idk how to do it. Can someone give me a light?
30 Replies
b1mind
b1mindβ€’4mo ago
make a chrome extension that does it ?
Pi, a future fluent jp speaker
I'm afraid we can't download extensions either:linux: But we can open devtools, notepads, libreoffice apps
b1mind
b1mindβ€’4mo ago
You wouldn't download it you would write it and side load it? xD
b1mind
b1mindβ€’4mo ago
no clue you would have to look it up
Pi, a future fluent jp speaker
Ic But that is an interesting idea
b1mind
b1mindβ€’4mo ago
but there has to be away because not like you are going to write an extension and just test it from the store πŸ˜‰ I've never written an extension though so I'm just pissing in the wind maybe >.>;;
Pi, a future fluent jp speaker
Devs get better by building code that helps with their laziness
b1mind
b1mindβ€’4mo ago
freeCodeCamp.org
How to Create Your Own Google Chrome Extension
By Sampurna Chapagain If you are a Google Chrome user, you've probably used some extensions in the browser. Have you ever wondered how to build one yourself? In this article, I will show you how you can create a Chrome extension from scratch. Table ...
b1mind
b1mindβ€’4mo ago
looks pretty damn ez πŸ˜„
Pi, a future fluent jp speaker
πŸ₯Ήyou re a life saviour
b1mind
b1mindβ€’4mo ago
hope it works gl
Pi, a future fluent jp speaker
If you were from the IT team and was looking in the people's logs, would you suspect an HTML, CSS and JS file creation as someone trying to do something malicious? :linux:
b1mind
b1mindβ€’4mo ago
I would suspect you were making a website xD
b1mind
b1mindβ€’4mo ago
no fo real you just mentioned all front end browser things xD Not like you are making bash scripts or something πŸ€·β€β™‚οΈ this would be more sus probably
Pi, a future fluent jp speaker
Now I just need to figureout how to make it collect data from a website
b1mind
b1mindβ€’4mo ago
ya feel me? but idk how your IT department is...
Pi, a future fluent jp speaker
Indeed I gotta talk with them someday
b1mind
b1mindβ€’4mo ago
Yea you can just tell them what you doing πŸ˜„ if its to optimize your work then ya buddy πŸ˜„
Pi, a future fluent jp speaker
For some reason the IT office there is so old and bad cared, I wonder why the company hates the IT team:linux:
b1mind
b1mindβ€’4mo ago
😦 System/network* admins get little love they deal with so much shit too ... stressful job πŸ˜‚
Pi, a future fluent jp speaker
🀣
dys πŸ™
dys πŸ™β€’4mo ago
Reload it in an <iframe>?
b1mind
b1mindβ€’4mo ago
oh thats so much better of an idea xD
Pi, a future fluent jp speaker
Where
dys πŸ™
dys πŸ™β€’4mo ago
Create a HTML page with the page you need to reload in an <iframe>. Then document.getElementById('some_frame_id').contentWindow.location.reload() (as per StackOverflow).
Pi, a future fluent jp speaker
Can i also collect any data from it
Chris Bolson
Chris Bolsonβ€’4mo ago
Why can’t you just to a normal fetch?
dys πŸ™
dys πŸ™β€’4mo ago
You could, but you'd need to parse the result. With an iframe, you can just iframe.contentWindow.document.getElementById('elem') (as per here).
Want results from more Discord servers?
Add your server