Editing Google App Script manifesto to add to home screen? - google-apps-script

I have been following this codelab to fit my purpose of adding a Google App Script html service page to home-screen on a mobile device:
https://codelabs.developers.google.com/codelabs/add-to-home-screen/#1
However I am not creating a Web Server for Chrome, is it possible to achieve this with the html service?
At the moment of editing the manifesto and republishing as web app it reverts any changes done to it. I have attempted to host my json manifesto on external sites and DevTools still cannot detect it.
My index.html from App Script.
<!DOCTYPE html>
<html>
<head>
<base target="_top">
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<link rel="manifest" href="https://api.myjson.com/bins/1gst5h">
</head>
<body>
Some HTML..
</body>
</html>
My Google App Script Web App is fully functional and can be accessed through a the /exec link, I want to implement it to mobile home-screen but I don't know if the manifesto is truly being edited as upon publishing it reverts any changes done to it.

Google Apps Scripts are published in iframes. Where is your manifesto located? In the Play store or in the App Script? If it is in the Apps Script it it is likely the the manifesto doesn't make it to the client.

Related

HTML mobile redirection - avoid opening in the app

I have a website redirecting traffic to Kayak.com, lately I noticed users that have the Kayak app installed (iOS / Android) on their device, are being redirected to the app, instead of remaining in the browser.
Sometimes the users would get a question "Open in the kayak app?", while for others it will immediately open the Kayak app.
I wanted to ask how to disable this behavior?
I want all users to remain within the browser, just open the URL in the browser without opening the app (similar behavior to Desktop).
The HTML redirection code:
<!DOCTYPE html>
<html>
<head>
<h1> HTML redirection - how to avoid opening on the app / offering "open in the app?" </h1>
</head>
<body>
<meta http-equiv="Refresh" content="1;url=https://www.kayak.com" />
</body>
</html>
I don't have control of app installations or Kayak's website behavior.
I have tried replacing the HTML redirection with PHP redirection,
And tried JS redirection as well.
Both approaches result in the same outcome (opens in the app / offers to open the app).
For convenient testings I added this code to a web page :
http://www.hotels-bargains.com/htmlredirection.php
Any idea on how to keep the users inside the browser?

How to enable this credentials-picker from Google in my site?

I'd like to integrate an auto-login pop-up as the one displayed in https://www.lequipe.fr
It detects your session in the browser and asks you if you want to join with your Google Account.
How can I implement this in my website? ( I already have Google Sign in ) - is using the GAPI API?
It's Google One-tap sign-up, it can be integrated using their API, follow this guide to setup Google One Tap in your website.
When you have added the Oauth2 ClientID in Google console. You would just use something like :
<!DOCTYPE html>
<html>
<head>
<script src="https://accounts.google.com/gsi/client" async defer></script>
</head>
<body>
<div id="g_id_onload"
data-client_id="XXXXXXXXXXXX-bk2lj5rs6l4c6g23nmtsfdh66qhfu921.apps.googleusercontent.com"
data-login_uri="https://localhost:3000/login"
>
</div>
</body>
</html>
and you would get :

onenote snapshot intranet webpage

Is it possible to take a webpage snapshot of a non-public facing website (intranet) using the OneNote API?
I'm using the OneNote API to create OneNote notebooks, pages and sections. It's working well. Unfortunately, when I use data-render-src and point it to an intranet website, it fails to take a snapshot. The application is on the same intranet as the website I wish to capture.
Example HTML:
<!DOCTYPE html>
<html>
<head>
<title>A page with an image: Webpage capture zzzz</title>
<meta name="created" value="2015-11-11T12:45:00.000-8:00"/>
</head>
<body>
<p>This page displays an image of the webpage.</p>
<img data-render-src="https://intranet.website.com" width="800"/>
</body>
</html>
Note: I can take snapshots of publicly accessible websites.
Webpage snapshot description
https://learn.microsoft.com/en-us/graph/onenote-images-files#add-a-webpage-snapshot
Image rendered from html description
https://learn.microsoft.com/en-us/graph/onenote-images-files#add-an-image-rendered-from-html
I don't think it is - the OneNote aPI server will not have access to that page because it isn't public. You'll have to extract the HTML and send it over through the API instead of using data-render-src.

How can I use Web App Manifest and Application Cache at the same time?

I'm trying to build a simple single HTML page that can be launched when offline (on Android, if that matters).
I'm using the Web App Manifest to give the app a name for adding to the home screen and display fullscreen with no browser chrome. This much works.
<!DOCTYPE html>
<html>
<head>
<link rel="manifest" href="mf.webmanifest">
<meta name="mobile-web-app-capable" content="yes">
</head>
...
</html>
This does not appear to be cached when offline. Separately, I can make a page which is cached offline using the application cache:
<!DOCTYPE html>
<html manifest="mf.appcache">
<head>
<meta name="mobile-web-app-capable" content="yes">
</head>
...
</html>
However, when I try to combine these two (so I can have an offline-cached page that launches fullscreen), the Web App Manifest is ignored and I only get the offline behaviour as in the second example.
What I ultimately want is a single page that can be added to the home screen, that opens full screen with no browser/OS chrome at all, and is cached for use offline. A solution that works just on Android using Chrome 65 is acceptable.
That's an interesting dilemma! I wonder if you would have better luck using
<link rel="manifest" href="/manifest.json"> as described by Google. Here's a link to their recommendations for the Web App Manifest.
The Web App Capable meta tag is primarily for full screen capabilities. If you want caching specifically, I think using the http-equiv="cache-control" header tag and its directives is closer to what you're trying to accomplish. Especially since Service workers aren't globally supported yet. I found a decent explanation on HTML caching here on stack: "How to set HTTP headers for cache-control."
Edit: another user has pointed out that Chrome will not honor this tag if a display is set up in the manifest file
The Service Workers feature provides the same capabilities as the deprecated Application Cache.
MDN has an article on Using Service Workers which I found very helpful in implementing what I needed to replace the Application Cache.

How to attach a favicon.ico to a Web App built with Google Apps Script?

Any ideas on How to attach a favicon.ico to a Web App built with Google Apps Script?
EDIT 1: Using UiApp
Thanks, Fausto
Google Apps now supports this (as of Nov 2015): https://developers.google.com/apps-script/reference/html/html-output#setfaviconurliconurl
Right now, the only way to do this is to embed your app in a blank Google Site, and take the following steps:
Navigate to the Attachment management section of your site (More Actions | Manage Site | Attachments)
Click Upload
Click Browse and select your favicon.ico file
Your favicon file must be named "favicon.ico"
Choose the option to Upload attachment to / (top-level)
Click Upload
Google Apps Script issue #2005 requests functionality to be able to set the app favicon with a UiApp.setFavicon(url) method. See the following link for more details: http://code.google.com/p/google-apps-script-issues/issues/detail?id=2005
You should be able to do this:
<head profile="http://www.w3.org/2005/10/profile">
<link rel="icon"
type="image/png"
href="http://example.com/myicon.png">
[…]
</head>
Source