add "Content-Encoding: br" header in Firebase - javascript

I deployed a js project on Firebase that is basically a container for a Unity WebGL app.
I am using Brotli as a compression format for the Unity build data that need to be loaded when the page is opened. However, it seems Firebase doesn't support br encoding because I am becoming this in the console:
"You can reduce startup time if you configure your web server to add "Content-Encoding: br" response header when serving "Build/Builds.framework.js.unityweb" file."
I enabled decompression fallback on Unity when packaging, this means the build data are exported as .unityweb. Without this option, they would be native .br format and the loader would just fail uncompressing them referring the same header issue.
Does anyone know how to enable this option somewhere in Firebase? Thank you!

Related

Keep getting ERR_HTTP2_PROTOCOL_ERROR when saving to file

The Problem:
I edit an asset file such has .js or .css via my code editor Sublime Editor 3. I then save those files to the server via an SFTP plugin on sublime. Then when I refresh the live website to view changes from my chrome browser (I have a plugin that flushes the browser cache so I see new changes.) I sometimes get a error on the chrome console that reads:
net::ERR_HTTP2_PROTOCOL_ERROR 200
Where the browser is not served the requested file. When I check my log file for Apache I see the following:
[alert] 657967#657967: *188534 pread() read only 7497 of 7498
My server is setup with Nginx running as a Web Server and Reverse Proxy for Apache.
How can I make it so that Nginx does not fail server the requested files even though they were just edited. Maybe sending back cache until it updates the new changes. Please advise because it is driving me nuts and I have no idea how to overcome it.
My workflow for JavaScript consists of me writing code and refreshing the live site to view web console on chrome. I need to be able to view the changes I made from the server via browser. I don't like local environments. I tried to google this topic many times with no luck so any help would be much appreciated.

electron: How to screenshot in every 5 minutes then send it to server using http post

I need some easy to make cross platform apps. So i think electron is a way to go since im already familiar with html, css and javascript.
What node modules that i need to do this? I read the electron docs and it only says about screen recording but not screenshot.
And what i need to do for encoding the image to png then send it to server as a file with http post?
The app im making is a simple anti cheat solution.

Failed to load resource: the server responded with a status of 403 (Forbidden) after Deployment Css & Js not working

1- I have Created a Web application & Locally its Css & Js are working Superbly Fine .
2 -But Now i Deployed my Project on server & the CSS & JS is totally bursted after deployment .
3 -Why this is happening What is the Problem .
the Paths are Correct for the CSS & JS.
Please Help me .
Regards
Deepak Dubey(Software Eingineer)
An HTTP response code of 403 Forbidden means you (the browser) don't have the right credentials to access the ressource.
Then, you may want to check the filesystem access rights AND the web server (IIS in your case ?) on the target environment.
If the ASP files are showing fine, I believe that :
you put your static ressources (CSS, JS, images) in a not readable directory, or those files are owned by a different user with no permissions to read by others.
Or, IIS has been told not to provide anything other than *.asp files.
I'm not a Windows regular user and I won't be aware of the specific manipulations to allow those resources to be delivered. If you don't know how to do that, I'll let the next Windows master reader coming here explain it to you.
Anyways, you may want to update your question tags. This has nothing to do with JavaScript or AngularJS, this related to IIS web server and/or filesystem authorizations.

How to include another SAP Cloud project resource into deployed SAPUI5 app?

I created several SAPUI5 web applications in Eclipse that have been deployed to a SAP NetWeaver PO 7.5 Application Server.
All these applications use generic components of a "common" project. I just made them available via the html header with this bootstrapping script-tag:
<!-- Bootstrapping UI5 -->
<script id="sap-ui-bootstrap"
src="/sapui5/resources/sap-ui-cachebuster/sap-ui-core.js"
data-sap-ui-libs="sap.m"
data-sap-ui-theme="path.to.custom.theme"
data-sap-ui-compatVersion="edge"
data-sap-ui-resourceroots='{"com.namespace.ui.specificapp": ".", "com.namespace.ui.common" :"/com.namespace~ui~common~web"}'
data-sap-ui-frameOptions="trusted"
data-sap-ui-appCacheBuster = "./,/com.namespace~ui~common~web/" >
</script>
This worked fine until I tiered to transfer these applications to SAP Cloud.
I imported the projects to WebIDE and first thing I discovered was that data-sap-ui-resourceroots attribute doesn't work anymore because application cannot find the components from the common project. So I deployed the common application to SAP Cloud and inserted the corresponding URL in the bootstrapping script-tag of the index.html like this:
<script id="sap-ui-bootstrap"
src="/sapui5/resources/sap-ui-cachebuster/sap-ui-core.js"
data-sap-ui-libs="sap.m"
data-sap-ui-theme="path.to.custom.theme"
data-sap-ui-compatVersion="edge"
data-sap-ui-resourceroots='{"com.namespace.ui.specificapp": ".", "com.namespace.ui.common" :"/https://common-aXXXXXXXX.dispatcher.hana.ondemand.com/"}'
data-sap-ui-frameOptions="trusted"
data-sap-ui-appCacheBuster = "./,/com.namespace~ui~common~web/" >
This allows browser to find the JS-files from the common project, but leads to this error:
Note: Your browser does not support JavaScript or it is turned off. Press the button to proceed.
This is message is thrown by the https://common-aXXXXXXXX.dispatcher.hana.ondemand.com/ host.
Analysing the HTTP request I see that the parameter Accept:text/plain, */*; q=0.01 is set.
I don't know why SAPUI5 is requesting plain text or where I can change this behavior. Does anyone know how to tranfer this application structure to the SAP Cloud?
The answer is pretty easy: The server blocks requests to other origins to prevent CSRF attacks. In the on premise solution all source files come from the same origin: the own server. In the SAP Cloud each application is deployed standalone with its own URL. Therefore the browser doesn't accept JavaScript files from other projects. The solution to access these files is to add the URL of the common project to the destinations in the SAP Cloud Cockpit.
FYI: Including the URL in the destinations enables you to use a relative URL for referring to external JavaScript files, so that they aren't blocked by the browser.

Why don't Django admin "Today" and "Now" buttons show up in Safari?

I'm developing a Django application that contains a model with a date/time field. On my local copy of the application, the admin page for that particular model shows this for the date/time field:
alt text http://www.cs.wm.edu/~mpd/images/bugs/django-date-local.png
This is as expected. However, when I deploy to my webserver and use the application from there, I get this:
alt text http://www.cs.wm.edu/~mpd/images/bugs/django-date-server.png
The application on the server is exactly the same as my local copy, except that I have debugging disabled on the server (but I don't think that should matter...should it?). Why does the admin app on the server differ from the local admin app?
Update
The issue seems localized to Safari. The "Today" and "Now" buttons appear when the admin site is accessed via Firefox. It looks like Safari can't download some of the JavaScript files necessary to show these widgets (strange that Firefox can, though).
I noticed that Safari is receiving a "304 Not Modified" code for the following files, but I'm not sure what that means, or how to fix it. Obviously, these are the JavaScript files and images that control the date/time widget:
RelatedObjectLookup.js
DateTimeShortcuts.js
icon_calendar.gif
icon_clock.gif
I think you have to look at what is different between your firefox configuration and safary config
Off the top of my head:
One could be configured to use a proxy (messing with the trafic) the other not. Make sure the configuration is the same in both.
Safari could have cached the error clear the cache before testing again.
Try to access the gif files directly from the browser (by inputting the full url of the images) and run wireshark on the wire comparing both GET requests and responses. Something WILL be different that will help you to track the problem.
If you're getting 304 on those files. Flush your browser's cache and try again.
If it doesn't load again anyway, make sure you are getting 200 OK.
It seems like you have admin media missing (hence js and images aren't loading). I generally do following.
in settings.py
ADMIN_MEDIA_PREFIX = '/media/admin/'
Then I symlink path of django.contrib.admin.media within my media dir. Say:
ln -s /var/lib/python-support/python2.5/django/contrib/admin/media/ /var/www/media/admin
Development server serves admin media automatically. But on production servers one generally prefers to server static stuff directly from apache (or whatever server).
Check the media location, permissions and setup on your deployment server.
http://www.djangobook.com/en/1.0/chapter20/
Have you tried checking out firebug's NET tab to see if the admin javascript/css/image files are all loading correctly?
I had that problem once.
Compare all those files from the dev server against the production server.

Categories