0

I am hosting a site using the New Google Sites, which has recently added a search functionality. I use web address mapping, so instead of https://sites.google.com/domain/site/page, I can direct my visitors to https://www.domain/page, which is great.

However, search results on the search results page, https://www.domain/_/search?query=term, open https://sites.google.com/domain/site/page, which I don't like.

Is there an option to change that, or can I make Google Sites redirect to the mapped web address?

If nothing else works, can I disable the search functionality?

Remember, I cannot simply use the answers given here because I can embed JavaScript only in an iframe that is not allowed to navigate the top frame:

Unsafe JavaScript attempt to initiate navigation for frame with URL 'https://sites.google.com/s/...' from frame with URL 'https://...-sites-embeds.googleusercontent.com/s/embeds/code/inner-frame-minified.html?jsh=...'. The frame attempting navigation of the top-level window is sandboxed, but the flag of 'allow-top-navigation' or 'allow-top-navigation-by-user-activation' is not set.

Uncaught SecurityError: Failed to set the 'href' property on 'Location': The current window does not have permission to navigate the target frame to 'https://example.com'.

I cannot even access the top frame's URL:

Uncaught DOMException: Blocked a frame with origin "https://...-sites-embeds.googleusercontent.com" from accessing a cross-origin frame.

I cannot even show a link to the real site based on whatever I think is a variable allowing me to guess on which domain we are as <a target=_top is blocked by the iframes' sandbox property...

2 Answers 2

1

The New Google Sites have made a long way since it was launched in November 2016, but is still very limited in terms of embedding and frames. The Classic Google Sites allows you to use window.location.href through XML, but this option is no longer available in the new Sites.

If you need to get the calling url within the site by html it will return something else then the url (e.g. https://[1234]-sites-embeds.googleusercontent.com/s/embeds/code/inner-frame-minified.html?jsh=[] )

1

This has finally been fixed:

Site search results - if you use a custom URL, a mapped web address from your domain, the site search results now give the domain URL rather than the sites.google.com URL if you search from the custom domain URL version of your published site.

Source: https://groups.google.com/a/steegle.com/forum/#!msg/sites-updates/b-k8-o2A4Ck/vxzCQ4YaEgAJ

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.