Integrate With Google button: Failed to execute ‘postMessage’ on ‘DOMWindow’ - google-workspace

I am trying to add Integrate With Google button to our website using the instructions at https://developers.google.com/gsuite/marketplace/button.
According to the instruction, I need to add:
<script type="text/javascript" src="https://apis.google.com/js/platform.js"/>
to head and then incorporate:
<g:additnow applicationid="[appid]"></g:additnow>
The button is not rendered. The error in browser console says:
Failed to execute ‘postMessage’ on ‘DOMWindow’: The target origin provided (‘https://accounts.google.com’) does not match the recipient window’s origin (‘http://server.local:8090’).
Load denied by X-Frame-Options: `
https://apis.google.com/additnow/additnow.html?usegapi=1&applicationid=[appid]&origin=http%3A%2F%2Fserver.local%3A8090&gsrc=3p&ic=1&jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.en_US.Vch8vd-lM6E.O%2Fm%3D__features__%2Fam%3DAQE%2Frt%3Dj%2Fd%3D1%2Frs%3DAGLTcCOgsbyjgLVijKgLfaXMbki4Pxbd_A#_methods=onPlusOne%2C_ready%2C_close%2C_open%2C_resizeMe%2C_renderstart%2Concircled%2Cdrefresh%2Cerefresh%2Claunchurl&id=I0_1517552817258&_gfid=I0_1517552817258&parent=http%3A%2F%2Fserver.local%3A8090&pfname=&rpctoken=19038946
> does not permit cross-origin framing.
A couple of points:
I am loading the page using the Tomcat web server
server.local resolves to 127.0.0.1
http anywhere browser extension is disabled
The page is not being loaded in an iframe
I tried loading platform.js without https. make no difference.
Any ideas?

Related

How do use ionic 6 with Auth0 ionic sample

I am using the https://github.com/auth0-samples/auth0-ionic-samples/tree/main/angular and following the examples in the readme file to to letter
Allowed Callback URLs:
com.auth0.samples://XXXX/capacitor/com.auth0.samples/callback, capacitor://localhost, http://localhost, http://localhost:4200
Allowed Logout URLs:
com.auth0.samples://XXXXX/capacitor/com.auth0.samples/callback, http://localhost:4200
Allowed Origins (CORS):
capacitor://localhost, http://localhost
Allowed Web Origins:
http://localhost:4200
And it worked twice and then all further testing I received this error
Failed to launch 'com.auth0.samples://dev-zhh5r4vf5zhgl2w4.us.auth0.com/capacitor/com.auth0.samples/callback?code=XXXXX&state=OGhsemEyWmF3MXlrOHkyVjRsanRhOVVKZ1dNZjdSb0swMlc3OWUtVnZYOA%3D%3D' because the scheme does not have a registered handler.
Has anyone else received this error and what was the fix?

Flutter web - the server responded with a status of 404 (Not Found), main.dart.js:1

Flutter web project works smoothly when running directly into chrome from IDE, but after calling flutter build web, and hosting the built web app is not opening(only a blank page) and showing this error which is
Failed to load resource: the server responded with a status of 404 (Not Found)
main.dart.js:1
Failed to load resource: the server responded with a status of 404 (Not Found)
(index):1
Uncaught (in promise) TypeError: Failed to register a ServiceWorker for scope ('http://localhost:8080/') with script ('http://localhost:8080/flutter_service_worker.js'): A bad HTTP response code (404) was received when fetching the script.
Did you publish resources not /build/web but /web?
First of all don't publish /build/web just publish /web folder's resources.
If you are hosting it with github then goto index.html and then change
<base href="/">
to
<base href="/YourRepoName/">
This worked for me..
I'm using nginx locally on my laptop to "force" flutter to serve my page.
The simplest config that I needed:
server {
listen 8004;
server_name your-domain.local;
location / {
root /path/to/your/project/build/web;
try_files $uri /index.html;
}
}
That's enough, the page is working without any problems :)

why `wget` can not get redirection for certain website?

wget hangs there while it accesses the following website. But when I use a browser to access it, it will be redirected to https://nyulangone.org. Does anybody know why wget can not get redirected in this case? Thanks.
$ wget http://nyumc.org
--2018-02-20 20:27:05-- http://nyumc.org/
Resolving nyumc.org (nyumc.org)... 216.165.125.106
Connecting to nyumc.org (nyumc.org)|216.165.125.106|:80...
When I used wget on the site you mentioned, this is what I get:
--2018-02-21 21:16:38-- http://www.nyumc.org/
Resolving www.nyumc.org (www.nyumc.org)... 216.165.125.112
Connecting to www.nyumc.org (www.nyumc.org)|216.165.125.112|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 179 [text/html]
Saving to: ‘index.html’
index.html 100%[==================================>] 179 --.-KB/s in 0s
2018-02-21 21:16:38 (8.16 MB/s) - ‘index.html’ saved [179/179]
In the index.html file, which bears the logo of NYU Langone Medical Center, it says: "The following URL has been rejected for security concerns. If you believe you have received this message in error, please summit an incident with our helpdesk at 212-263-6868..." So, it may not redirect because the website can detect that you are a bot and not a browser. You could attempt to change the user agent string and other HTTP headers to avoid detection, but I'm not sure why you wouldn't just turn wget on https://nyulangone.org. Judging from information on archive.org, nyumc.org has been redirecting to other sites for at least the last 5 years. It was redirecting to http://www.med.nyu.edu until 2016, at which point it started redirecting to https://www.nyulangone.org.
I hope that helps.

'browser.goto()' generates UnhandledAlertError

I tried to use the 'watir-webdriver', and it works just fine (on Ubuntu Linux 11.10, with Firefox).
However for one website, that checks the browser and displays an modal alert, I get an error when calling the 'goto()' method:
b.goto('http://www.website.com/that/checks/the/browser/and/displays/modal/alert.html')
Selenium::WebDriver::Error::UnhandledAlertError: Modal dialog present
from [remote server] file://....
Here is the content of the HTML page:
<script type='text/javascript' language='JavaScript'>browserCheck();</script>
How can I avoid getting this error?
Regards,
PM

GWT : separate js + css + images from server

We'd like to have the following configuration :
one server is replying to GWT RPC : x.com (the one running Java)
another server is serving js / css / images : y.com (for bandwith optimization)
So the main page is : http://x.com/index.html
and contains this line: <script type="text/javascript" language="javascript" src="http://**x.com**/my-app.nocache.js"></script>
We're getting a SOP error: Unsafe JavaScript attempt to access frame with URL ...
Any suggestion, help about that ?
Add the following to your gwt.xml:
<add-linker name="xsiframe" />
This will generate slightly different code, that can be loaded cross-origin. Your "host page" will still have to be loaded from the same server you run your GWT-RPC servlets on, to not hit the SOP.
See this FAQ entry (the "xs" linker predates the "xsiframe" one, that latter is now preferred, and could eventually even replace the "std", default linker)
You have hit Same Origin Policy which prevents making XMLHTTPRequest to servers other than origin server. This effectively prevents cross-domain GWT-RPC.
The possible workarounds are described in Making cross-site requests:
Run a proxy on your server
Load the JSON response into a <script> tag