AJAX Microgames [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 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.

Related

Chrome Extensions: Can I run a game on them? [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 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

prevent bots / scrapers executing javascript to get output [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 5 years ago.
Improve this question
I see allot about Cpatcha's and Submission forms / methods to block bots and content scrapers / leechers but nothing about blocking those who take the entire JavaScript contents and execute it to obtain and view what it is outputting.
Is it possible to prevent bots executing JavaScript to obtain the output.
I have looked at if statements within JavaScipt checking screen resolutions, keyboards, mouse, touch screens basic human required functions etc but it is a hard area to find information on.
if (bot){ //don't execute Javascript don't let the bot get the real output.
return;
}
The only known mechanism is to use minification and obfuscation of your javacsript functions. Change them on every deploy or every day through a script process. Another thing is not to have window methods on the global space.
You may want to look at Web Assembly, but not all browsers have currently adopted it.
There is no straight forward way to achieve this perfectly. If people put enough time they can crack it out.

Program to repeatedly get the contents of a webpage [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 wish to get the contents of a web page that requires me to be logged in (and one that I do not have control over: e.g. Twitter or Facebook), for example I can have Chrome running and I can see Ajax updating the page updating, but I want to periodically get the contents of this page and somehow save it. I don't mind leaving a computer running to achieve this...
You can use any http software to achieve this (like curl). Depending on the site it will take some investigation of how requests are made, in what order, the post data, the encryption, the user agent, cookies, headers, etc. etc.
It could take some time to find the right recipe.
Generally these sites don't want you to do this though, so don't be surprised when you run up against captcha or other clever methods from preventing exactly what you're trying to do.
Chances are, if you have to ask, you won't get in. But have fun.

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.

Reasons\ and Benefits to build SPA application [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 9 years ago.
Improve this question
As I understand, SPA means
Move maximum of logic to the client. Means client only receive JSON objects from the server by requesting them and nothing else
Push all our html to as single page
Maybe something else?
Questions
What are reasons/benfits to write Single Page Application?
Especially, what are the benefits to push all our html to a single page?
One of the big differences with SPAs is responsiveness. They just appear more responsive to the user because there's no gaps while a page has to load. Users can also be given direct feedback while they're waiting for changes (like spinning icons or progress bars). This kind of feedback is well received by users and decreases the perception of wait-time. Users can also be interacting with the app in multiple ways, all without having to wait for a new page load for each interaction.

Categories