Search code examples
google-app-maker

App Maker - Drive Picker widget - Empty, white dialog if embedded in Google Site


We are using Drive Picker widget to select files in user's Drive.

The app is configured to run as user.

The app works properly when running at https://scripts.google.com/... URL; if we embed the app in a New Google Sites instance (google.com URL), the drive picker shows an empty, white dialog only.

We have some errors in Chrome's Console:

Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://docs.google.com') does not match the recipient window's origin [...]

Invalid 'X-Frame-Options' header encountered when loading [...] 'ALLOW-FROM https://script.google.com' is not a recognized directive. The header will be ignored.

Uncaught Error: Incorrect origin value. Please set it to - (window.location.protocol + '//' + window.location.host) of the top-most page at new JJ (13808338-picker_modularized_opc.js:975) at _createPicker (13808338-picker_modularized_opc.js:977) at HTMLDocument.

Firefox says

Load denied by X-Frame-Options: https://script.google.com/ does not permit framing by https://sites.google.com/s/[...]/edit?authuser=0.

We cannot find any clue about restrictions and limitations in Drive Picker's docs.

Thank you.


Solution

  • I run App Maker on my bare domain and have picker widget working.

    1. In App Settings: Check Allow embedding app
    2. In Drive Picker's onPickerInit: pickerBuilder.setOrigin("https://example.com/");