Felicious / Taiwan-Numba-ONE

Front-end Google App Script that uses Google Forms, Sheets
1 stars 0 forks source link

github link to CSS not applied #21

Closed Felicious closed 3 years ago

Felicious commented 3 years ago

Bug: When evaluating the Index.html file on Google Apps Script, the css styling isn't applied.

https://github.com/Felicious/Taiwan-Numba-ONE/blob/bf4dd0f3a0c66ff6361ce908f6fb5feb297f400d/html/Index.html#L9

The loaded page has 0 css at all-- is the github link wrong again?

Felicious commented 3 years ago

First, Derrick instructed me to open Dev tools (Ctrl + Shift + C), then reload the page.

devtools

Then, he told me to find the style.css file among the files that shows up. I see it under "Status 200"

network

He told me to click on it and switch to the networks tab and look at it under "Header"

network1

He concluded that the it was successful in requesting the css file from github, so the error is not caused by the connection or CORS (What is cors?)

He then told me to open up the console tab.

console

He then concluded that issue is with something related to CORS but newer; it's some security stuff to prevent malicious stuff, which is fetching stuff from a different domain.

https://developers.google.com/apps-script/guides/html/best-practices#separate_html_css_and_javascript

An exerpt from those links:

How does CORB “block” a response?

When CORB decides that a response needs to be CORB-protected, the response is modified as follows:

The response body is replaced with an empty body. The response headers are removed.

this is why the header was blank.