I have developed an application with HTML5. I want to know how I can make a shortcut/access-point URL icon to access my offline page.
Adding /path/favicon.ico to your cache.manifest, unless I'm misunderstanding the question.
If you mean a desktop shortcut, you can't do that through the app itself, have to use an external program.
Related
I'm creating a web game using Godot.
For close the game, i tried to use `get_tree().quit()`.
If I use it on the IDE, it works. When i tried it on my server (after exported the project) it doesn't work.
I'm sure that Exporting setting are okay.
How can I close the game?
And, how can I add an hypertext link (similar to html `` tag)?
Thanks for your answer and sorry for my bad English
Exit the game
On the web, using
get_tree().quit()
Should work. That is, it should stop the runtime. The game will not continue running. It does not close the browser tab. In fact, browsers have restriction on scripts closing tabs.
Note: Make sure you are using Godot 3.2.3 or newer (see #39604). I tried it, it works.
Making a link
You can a LinkButton, which is a button that looks like an hyperlink. And you want to connect its "pressed" signal to a script where you use OS.shell_open, for example:
OS.shell_open("https://example.com")
Note: This result in a new tab in web exports. On the desktop it opens the default browser.
Navigating the browser
Since you ask about closing the game, and about making a link, I'll venture to guess that what you actually want is to navigate (leaving the game and going to another page), you can accomplish that with JavaScript.eval, for example:
JavaScript.eval("window.location.href='https://example.com'")
Note: This can only work on a web export.
Detecting Web Build
You can use OS.get_name to identify the platform.
For example, you can do this:
if OS.get_name() == "HTML5":
JavaScript.eval("window.location.href='https://example.com'")
else:
OS.shell_open("https://example.com")
Which will navigate the browser if this is a web build, but if it isn't, it will try to open the default browser.
I want to develop an app (for Chrome desktop) that will retrieve data from different webpages the user surf to and aggregate it, or inject some added JavaScript functionality to those pages, later on showing the user statistics about the webpages he surf to. Like how many pages the user have been having more that 3 images in them.
Now, I know Chrome Extensions can Inject JavaScript code and therefor also retrieve data, but I want my App to be a Chrome App. Can it also pull data from WebPages and / or Inject JS to those pages ?
Thanks.
A Chrome App is, by design, isolated from the browser. You can't enumerate tabs, inject content scripts, etc. at all, as you can see from an entirely different list of available APIs.
While you could embed a pseudo-browser in your app using the <webview> tag, it's going to be hard to convince the user to use your limited browser over "real" Chrome.
If you want to interact with a browser, you need an extension. If you also really need Chrome App capabilities you'll need both separately, and they can talk to each other.
I am trying to learn what could be the best ways of developing user interface for chrome extension for my application. The 2 approaches that I have come across are i)Using a browser action with default_popup html page or ii) Injecting some component into the page that is loaded in the tab. First approach is pretty straightforward but has some restricted use (like it is destroyed on tab/window switch which is useful in the context of my application). Coming to the second approach, it seems it requires every component which can be injected to be listed under web_accessible_resources. As the extension UI gets complex, this list is bound to increase. But surprisingly, Pocket extension's manifest does not seem to list any js files or html files though it does not use a popup page too. How does it work? Is there any other way of creating the user interface too?
Have you checked on the documentation regarding chrome.windows API? This API will allow you to create new windows and tabs in the browser, so you can create the html content from your extension. All you'll need is declaring the pertinent permissions on the manifest file. You can read more information here: https://developer.chrome.com/extensions/windows
Im in the process of building a HTML5 based web application which ideally would be made downloadable from a web based url via a link.
Should this link be clicked on a desktop machine, it would bring up some sort of overlay informing the user that they need to be on a mobile device to be allowed the download.
Basically Im looking for a way to enable the download only via a mobile device.
If anyone has a solution or can reference another page that does ( Ive looked but not been able to find anything ) it would be much appreciated.
Thanks in advance.
There is two standard ways to do it:
Check on client (parse UA or detect device features).
Check on server (parse UA).
To parse UA use ua-parser-js on client and you will able to get device type desktop, tablet or mobile. Or with nodejs on server side (it allows you to hide algorithm). But UA parsing is not a assured method (because UA could easily be overwritten).
Device features detection depends on target device. You can check browser plugins, protocol support or something special. This is an example of how does Apple checks iTunes support.
I'm currently learning how to make facebook apps, and I've hit a problem.
Usually when I make flash applications, I can use the index.html and run the swf from a webserver.
However, I tried to make a facebook iFrame app using the same setup, all I get is the Alternative Content Text.
Any experienced flash/facebook developer help would be greatly appreciated by this newbie.
Below is what happen to my tutorial app.
http://apps.facebook.com/jeffcheetest/
Do you have filled the field "App Namespace" in the Developer Application Settings? I think it could be the problem...
Are you using FBML? If so, it may be easier to switch to iframe in order to have the swf work in the .html page as you expect it to work. Otherwise, you will need to implement your swf through fbml tags or fbjs code.