How to launch my swf game in my manifest.json file for my Chrome packaged web app? - json

I'm struggling to get my first Flash game on the Chrome store as packaged web app.
All the tutorials I manage to find online are old and obsolete, or missing crucial info for a noob like me.
This is what I have so far for my manifest.json file:
{
"name": "Snappy Turtle",
"description": "Swim dangerous waters.",
"version": "1.8",
"manifest_version": 2,
"app": {
"background": {
"scripts": ["background.js"]
}
},
"icons": { "16": "favicon.png", "128": "icon.png" }
}
Somewhere in the mix I need something like the following so it will actually launch my game:
"launch": {
"local_path": "index.html"
}
},
but any way I try to add it I get errors, and of course, if I leave it out, no error report, but then the game wont run. ;)
Can any of you kind people who actually know what they're doing please point out to me the proper way to add this crucial bit in a way that chrome will actually accept?

You can't do it with a (new) Chrome App.
From Disabled Web Features:
Disabled: Flash
Workaround: Use HTML5 Platform.
You might get it working by embedding an external page in a <webview>, but I doubt it will work - my guess is that the ban extends to webview content.
FYI, all flash game "apps" in the Chrome Web Store are not Chrome Apps, but hosted apps (also called installable web apps). Note that the documentation for them is currently broken, there are still traces at this tutorial.

You can run it by doing this code:
<object>
<embed src="file.swf" width="100%" height="100%"></embed>
</object>

Related

Why do I get "Unsupported extensions disabled" on my extension?

I did a Chrome extension, successfully published it on Chrome Webstore, a friend installed it yesterday, and today, when launching Chrome, he sees Unsupported extensions disabled:
What are the usual reasons for that? How to fix it?
Note: the extension is just a minimalist:
{
"name": "...",
"version": "1.0",
"description": "...",
"content_scripts": [
{
"css": ["fix.css"],
"matches": ["http://*/*", "https://*/*"],
"run_at": "document_end"
}
],
"manifest_version": 2,
"permissions": ["*://*/*"]
}
and a fix.css that modifies the design of certain elements. Nothing else is in the extension. It is still accepted/published on the Chrome Webstore.
This is because extension is not published in Chrome webstore. Perhaps installing Chromium browser can help. It should allow to use non-webstore extensions.
There is also bit complexated way to use pre-installed extension described here.
As recommended in this page:
Try this removal procedure ... http://malwaretips.com/blogs/remove-discount-buddy-virus/
Try running the new Google Software Removal Tool ..(Windows Only). Do Browser Reset at end.
You may also check this Important: Updates on Chrome Extensions.

Why is my 'add to home screen' Web App Install Banner not showing up in my web app

I've created a service-worker and manifest.json file in order to display an 'add to home screen' Web App Install Banner for Chrome Browser Users.
It is not working as intended.
Here is my manifest.json file
{
"name": "MySite",
"short_name": "Mysite",
"start_url": "./?utm_source=homescreen",
"icons": [{
"src": "assets/cacheable/images/shortcut/120x120.png",
"sizes": "128x128",
"type": "image/png"
}, {
"src": "assets/cacheable/images/shortcut/142x142.png",
"sizes": "142x142",
"type": "image/png"
}, {
"src": "assets/cacheable/images/shortcut/192x192.png",
"sizes": "192x192",
"type": "image/png"
}, {
"src": "assets/cacheable/images/shortcut/192x192.png",
"sizes": "384x384",
"type": "image/png"
}],
"orientation": "portrait" ,
"background_color": "#fff",
"display": "standalone",
"theme_color": "#fff"
}
Please let me know if I forgot to add anything?
First, let's check if your manifest fulfills the requirements for showing Web App Install Banners.
Requirements
Full (current) requirements for showing Web App Install Banners are*:
Have a web app manifest file with:
a short_name
a name (used in the
banner prompt)
a 144x144 png icon
a start_url that loads
Is served over HTTPS (a requirement for using service worker).
Is visited at least twice, with at least five minutes between visits.
Reference
Okay, so for now let's assume this is all valid. Let's move on to testing.
Testing
To test if you've installed it correctly, you can try the following steps:
Open Chrome DevTools,
Go to the Application panel
Go to the Manifest tab
Click Add to homescreen.
A prompt should now show on top of your browser asking if you want to add the url to your things (on Chrome desktop).
Troubleshooting
If after testing you are getting the following error in your console:
No matching service worker detected. You may need to reload the page, or check that the service worker for the current page also controls the start URL from the manifest
Then please make sure that 1. Your service worker is functioning properly and without errors, and 2. Your start_url matches an actual url of your website that loads. Else, you will never get the prompt to show!
Additionally,
Do note that users (and you!) can also add to the home screen manually through the the (Android) Chrome menu. It is not required to wait for the prompt! I add a lot of websites I tend to use daily to my homescreen, and I hardly ever see a banner!
* Do note that these requirements could change from time to time (they have before!). An update to 'Add to home screen' coming in 2017 has already been announced here
** Also note that these requirements differ significantly from native app install prompts.**
your manifest.json seems good enough.
and the above mentioned points by #Extricate are correct and perfect.
So the next question is have you implemented service-worker for your app?
I read somewhere that an empty service-worker file would work but when I tried an empty implementation of service-worker, it said that
'Site cannot be installed: the page does not work offline'
So I suppose that latest chrome version would not be supporting the A2HS prompt for APP INSTALL BANNERS if you service-worker dont support offline working.
You can try going to Basic web app prompt , go to devtools in chrome, navigate to Application tab.
There you will find manifest.json. On LHS of the manifest file, you can see the ADD TO HOME SCREEN. When you click, it will print
'Site cannot be installed: the page does not work offline'
PFA screenshot for same
In your service worker js file add this one line of code:
self.addEventListener('fetch', function(event) {});
May be usefull, as had similar issue. The Install infobar appeared once and never again.
From Developers Google
The mini-infobar will appear when the site meets the criteria, and
once dismissed by the user, it will not appear again until a
sufficient amount of time has passed (currently 3 months).

Kiosk mode in Node-webkit not working?

I'm trying out the basic tutorial for Node-webkit.
The manifest includes options to make your app go fullscreen or even in kiosk mode, which is exactly what I need.
Sadly, the app does not open in fullscreen or kiosk mode no matter what I put in the manifest file.
I'm on Mac OS, I downloaded "node-webkit.app". I am compressing my manifest.json and index.html into a "app.nw" zipfile, and then opening that with the mac app. Is there anything I'm overlooking?
My manifest file:
{
"name": "mydemo",
"main": "index.html",
"window": {
"title": "baby's first node-webkit demo",
"resizable":"false",
"show_in_taskbar":"true",
"fullscreen":"true",
"kiosk":"true"
}
}
OK, so I'm answering my own question here... don't use:
"kiosk":"true"
Instead use
"kiosk":true
I was under the impression JSON always uses quotes around properties...

<webview> tag not working Chrome Packaged Extensions

Anyone have any advice about getting to work in Chrome Packaged Apps? I have followed everything in the tutorials, and my webview doesn't load the URL, but the container shows up. I used horrible colours on purpose so I could see the frames (sorry in advance)
Manifest.JSON - http://pastebin.com/dkDx3qUr
Window.html - http://pastebin.com/RBQZ5MNG
Any advice you could give would be great!
Google Chrome Version 4.0.1312.57 m
Sadly, your pastebin is outdated, but I guess the problem is your packaged app is a legacy packaged apps.
To fix that, convert this:
"app": {
"launch": {
"local_path": "browser.html"
}
},
to this:
"app": {
"background": {
"scripts": ["main.js"]
}
},
main.js should then contain this:
chrome.app.runtime.onLaunched.addListener(runApp);
chrome.app.runtime.onRestarted.addListener(runApp);
function runApp() {
window.open("browser.html");
};

Chrome Extension to Set Local Homepage?

Since it seems none exist, I'm trying to make a chrome extension to set my New Tab page to a local .html file. Here's what I have so far:
{
"name": "MyHomepage",
"version": "1.0",
"manifest_version": 2,
"description": "Set an HTML page as your New Tab page",
"browser_action": {
"default_icon": "icon.png"
},
"chrome_url_overrides" : {
"newtab": "/Users/shortname/Documents/Home.html"
}
}
However, when I load a new page, it gives me this:
No webpage was found for the web address: chrome-extension://(gibberish)//Users/shortname/Documents/Home.html
It seems Chrome is sandboxing my extension somehow. Is there a way to let it access my local file?
Chrome's extension API does not allow for direct reading or writing from/to disk.
If you want to do that you'll have to use a NPAPI plugin in your extension:
http://code.google.com/chrome/extensions/npapi.html
You can use Native Messaging instead of NPAPI https://developer.chrome.com/extensions/messaging#native-messaging