jsoma / tabletop

Tabletop.js gives spreadsheets legs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CORS failure

marksto opened this issue · comments

Hello, Jonathan.

I strangely get an "Failed to load ... No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access" error message with Tabletop today.

My spreadsheet is 100% new, public and directly accessible. Playing around with its access rights and generated URLs (as you described in README) doesn't seem to help.

Did Google change its CORS policy for public sheets?
Can you, please, check it playing with Tabletop request headers?

Thanks in advance!

Cheers,
Mark.

UPD. Found out that Spreadsheet is also to be in a Published to the Web state (see this blog). It generates another type of link, with "/d/e" fragment you've mentioned in README, i.e. "https://docs.google.com/spreadsheets/d/e/${2PAXC-SHEET-ID}/pub?output=csv".

Still, Tabletop gives the same old CORS error. =/

Nevertheless, a simple as hell jQuery AJAX request
$.ajax({ type: 'GET', url: publishedSheetURL });
gives the expected result, even at localhost.

Hi,
I also encounter this problem, and I have manage a way to work around this issue.
The following are the steps that I took,

  1. Get the share link from the top right corner share button. (The permission that I use is anyone with the link can view)
  2. Go to File -> Publish to the Web and publish the spreadsheet.
  3. use the link from step 1 and paste to the javascript code.

It seems like in order to let the link worked, the following are required

  • use the share link from step 1
  • published the spread sheet from step 2.

Hope this will help.

Thank you, I tried everything and only that exact 3 step procedure stopped the CORS error!

I reported the following in August 2017. In my case, copying the whole link from share doesn't work. I have to grab just the ID
#147 (comment)

Just tried @mike820324 comment and it worked pretty well.
Thank you

@jsoma I think the README instructions for tabletop needs some love. A number of us are encountering barriers to using tabletop recently.

@mroswell let's show them some love then and update them :D

Would rather have an authoritative voice. Though I offer my comments in various threads as helpful resources, I'm just not equipped right now to be the authoritative voice.

Updated the docs to reflect the miserable world we live in, now says you must both publish and share. Hope this helps!