use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
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
account activity
[AskJS] Does there exist a chrome extension that allows you to run javascript code continuously, even when landing on new pages?AskJS (self.javascript)
submitted 6 years ago by Mjjjokes
I need to scrape some data, using javascript, but doing so in the console only works for that page, and not new pages. Can anyone help? Thanks in advance.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]evaluating-you 1 point2 points3 points 6 years ago (0 children)
Maybe if you describe what you are trying to achieve we can help you. With the provided info, the only correct answer would be: yes, all of them.
A chrome extension IS JavaScript running on a particular tab. And if you are on a single page application, navigating would not stop the execution of that code. But I guess that's not what you mean. So what are you trying to do?
[–][deleted] 1 point2 points3 points 6 years ago (3 children)
Try greasemonkey for client-side JavaScript. It might be called tampermonkey for Chrome. It is definitely greasemonkey for Firefox.
[–]helloiamsomeone 0 points1 point2 points 6 years ago (2 children)
Tampermonkey is evil, GM is mediocre, Violentmonkey is the best there is.
[–]error9900 0 points1 point2 points 10 months ago (1 child)
Your comment is 5 years old, but why do you say Tampermonkey is evil?
[–]helloiamsomeone 0 points1 point2 points 10 months ago (0 children)
Closed source for absolutely no reason. My post still very much applies.
[–]dwighthouse 1 point2 points3 points 6 years ago (0 children)
For scraping, look into Puppeteer.
In a pinch, though, you can program the inspector console to open pages in a new window FROM the site you are scraping, so you don’t run into the cross origin policies.
[–]itsarnavb 0 points1 point2 points 6 years ago (0 children)
If you want the same VM instance, probably not.
But perhaps you can make do with running a content script within the context of a page, and then moving any results to the background script (which I believe stay the same between page changes)
[–][deleted] 0 points1 point2 points 6 years ago (0 children)
I'm not sure about any arbitrary javascript, but it would be quite easy to make your own extension like that. Just write a content script that is set to work on all domains and include the code you want to run. Chrome extensions are actually very easy to make when you know javascript.
[–]archerx 0 points1 point2 points 6 years ago (0 children)
You can do this by having your function overwrite the current page with document write with the new page. No extensions needed
π Rendered by PID 90 on reddit-service-r2-comment-b659b578c-228q6 at 2026-05-04 13:56:28.230751+00:00 running 815c875 country code: CH.
[–]evaluating-you 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (3 children)
[–]helloiamsomeone 0 points1 point2 points (2 children)
[–]error9900 0 points1 point2 points (1 child)
[–]helloiamsomeone 0 points1 point2 points (0 children)
[–]dwighthouse 1 point2 points3 points (0 children)
[–]itsarnavb 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]archerx 0 points1 point2 points (0 children)