Chrome Extensions: Can I run a game on them? [closed] - javascript

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I'm looking into chrome extensions, and I was wondering if it's possible to change a specific website to add a box and run a game on it.
I believe I can change the website, no problem. But I'm having trouble figuring out what I can use to run a game in there.
Do have in mind that I'm relatively new to web dev (but not to code).
Thanks in advance!

Yes, it is possible to manipulate pretty much anything on the website, as long as the user who installs the extension gives you permissions to inject content scripts into the page. Content scripts are the Javascript and CSS files that would contain logic for your game. Once injected, you can target a DOM element in the page and initialise your game there or even create a new element and embed it somewhere in the HTML.
This is a good place to start https://developer.chrome.com/extensions/content_scripts

Related

tampermonkey best practices for sharing [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
I have developed a userscript for blind users that reads screen on a card-game website playing audio files and also lets user play cards using keyboard instead of mouse.
The script is now working fine on my computer but I plan on keep updating it with new features.
Initially this was designed for just 1 person, but word spread and more people from other countries are gonna use it.
My question is this: what is the recomended way to export the script into their computers? Is there any kind of "userscript store" for tampermonkey scripts where I can place the script for anyone to download and use?
I have seen tutorials explaining how to download scripts other made, but none about sharing the ones you make with others.
How are new versions managed?
I was thinking about copying the main code into my personal website and reference it as a required script so anytime I update it they get a new version, but wonder if this is the way to go.
You can host tampermonkey scripts on Greasyfork. You can either upload code directly or link to a file in a GitHub repository, which can be set to auto-update.
There are many other ways/places to host tampermonky scripts, this is just what I've used recently. You can read about the other ways, here.

Popup HTML to last viewed page [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I am making an Chrome extension. I'm not an coding expert, but I understand the basics of html, css, and how to make an chrome extension.
I have an popup html, and I want to reference to other html pages, but every link will open in a new tab. I searched all over the internet, but I couldn't figure out how. When the popup is open on another page, and it closes, I want it to open on the same page. Is there an way, and how?
Thanks in advance.
Since I don't have a detailed context from your question, I'm gonna suggest you use <iframe> tag offered by HTML in order to load the desired page inside the popup
here's some useful reference
https://www.w3schools.com/tags/tag_iframe.ASP

AJAX Microgames [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
If you're not familiar with the concept of a Microgame, check out this video of WarioWare Twisted.
I'm interested in setting up a site where users can play series of browser-based Microgames which are delivered to them by a server. Ideally this would allow me to crowdsource the games and have an open submission system. What sort of scheme could I use to make this work?
I'm thinking that one way to do it would be to have each game consist of:
A javascript file that defines a MicroGame object that controls a rectangular portion of the screen, gets input and timing information from the main page, then calls back to the main page with a "Success" or "Failure" message.
A folder of assets that must be downloaded before the game executes.
Is this possible to do, client-side within a browser? Where would be a good place to start figuring this out?
There are a lot of open issues here. The biggest problem is what language do they submit games in which you can execute safely on the players machines? That said, there are tools like this out there. You could look at the excellent Play My Code for inspiration.

Javascript - Dynamically Create it? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I have a set of users with different permissions. Depending on what permissions they have, they should only have access to a certain javascript files. In terms of speed, is it better if on every instance of their visit, I check the permission of that user, create one javascript file that contains ALL the javascript commands accessible to that user, and load that file into the view?
Or is it better to have multiple javascript files, call them page#_permission# (for instance, page1_permission10.js), and just load the corresponding files every time the page loads?
Thanks
It is probably faster to load in only the JavaScript that is needed BUT...
It probably will not be significant enough to warrant the effort. Futhermore, you may find youself in debugging hell just to save a few ms.
Firefox and many other browsers have built in tools which describe how much time it takes to load a page. Below a recent example for stackoverflow.com. You can perform a similar operation you site and locate the bottlenecks.

Scraping sites with javascript screen delay [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I'm attempting to scrape a site that has a split second javascript delay.
I'm currently using python for scraping. Whenever I 'get' the page, the javascript delay has not finished and is has not completely loaded the new dom yet.
How would I scrape such a pge?
You can extend Mozilla to build a web scraper which can leverage the full power of the web browser. After all data have been loaded and the DOM has been built, you can extract needed data from the DOM using XSLT. If the DOM was dynamically changed after initial loading, you can take some approaches to wait for the changes. Visit http://www.gooseeker.com for more information. GooSeeker publish a similiar tool free for everyone. Most of codes are in javascript and readible, from which you can find how it runs.

Categories