Shopify Avoid unload event listeners - events

Scan my site and found this Avoid unload event listeners.
enter image description here
I check my asset folder line 13 and got this codes. Tried to do as what it says here https://developer.mozilla.org/en-US/docs/Web/API/Window/pagehide_event which work when I rescan it but the thing is, the website images won't load at all.
P.S. about to post the line 13 codes but I reached the character limit.

Related

Failed to load resource: net::ERR_CONTENT_DECODING_FAILED error while loading laravel css file

While executing a web page after loading HTML, CSS file is not loading & not applying the UI changes.
In browser console it is showing the following error Failed to load resource: net::ERR_CONTENT_DECODING_FAILED
One more issue is "that error is occuring only for the first time", If I reload the page the error will be gone & will load the CSS properly.
One solution I found after browsing is to enable gzip encoded, That is already in place.
Console error message
Welcome to stackoverflow.
This is a bit of an annoying error. But ill do my best Lacking what information I have on your error exactly.
What is this error?
This can happen when an HTTP request's headers say that the content is gzip encoded, but it isn't. It doesn't always happen, as you've discovered. But happens occasionally.
What can you do?
Check to see if Route::get('/') pointing to the correct
controller/code?
check to see if output_compression is added to your php.ini
Add this code: zlib.output_compression = On
try going to /config/config.php(this may not be right in your case) and set the following to false $config['compress_output'] = FALSE;
Further reading
(more about what the error actually is)
https://superuser.com/questions/172951/chrome-error-330-neterr-content-decoding-failed
https://www.solvusoft.com/en/errors/runtime-errors/google-inc/google-chrome/330-chrome-error-330/
As I referred about this cause of error, I think adding zlib.output_compression = On to php.ini will help you.
You can find this php.ini file in your php installed folder. In that find zlib.output_compression and initially it will be in OFF stage. Change it to zlib.output_compression = On.
For more information you can refer https://stefantsov.com/fixing-err_content_decoding_failed-in-apachephp/
If you are using Cloudflare make sure Brotli is enabled.
To enable Brotli, follow these steps.
Log in to your Cloudflare account.
Choose the appropriate domain.
Click the Speed app.
Click the Optimization tab.
Toggle the Brotli switch to On.
https://support.cloudflare.com/hc/en-us/articles/200168396-What-will-Cloudflare-compress-
For me the problem was this:
throw new CHttpException(Yii::t('general', 'This category has no product.'));
Becose I use Framework Yii 1.1, I changed that with this:
Yii::app()->user->setFlash('notification', "This category has no product.");
And in front-end I display the message like this:
if (Yii::app()->user->hasFlash('notification')) {
echo '<div>' . Yii::app()->user->getFlash('notification') . "</div>\n";
}

Enabling Views custom module causes an Ajax HTTP error on Drupal 7

I'm working on a custom module that will describe an external table to the Views module. Inside my module folder I have the required mymodule.views.inc file. However, whenever this file is present and my custom module is enabled Drupal constantly gives Ajax HTTP Error pop ups when I use a site feature that has Ajax (any of the spinning daisies trigger this). The pop up always contains the module code in mymodule.views.inc after it says Ajax Error. The weird thing is every time I load the front page the PHP code in mymodule.views.inc is always displayed on the top of the front page.
I've seen this problem on SO and other sites a lot, but most of the time it can be traced back to an updated jquery.js file or a php.ini setting that will give scripts more time to run. So far neither of those fixes have worked. The only way I can make it go away for now is to either disable my custom module, or rename mymodule.views.inc to something else.
Here's an example of what the message looks like (not verbatim copy, since I can't copy from these alert messages in Chrome).
An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /?q=admin/structure/views/view/viewiamtryingtocreate/preview/page/ajax
StatusText: parseerror
ResponseText: /*
* header file to my mymodule.views.inc
* file I wrote
*/
//more php code follows
//lots of unicode characters intermittently show up in my source code
\u003C\/div\u003E\n...
//source code continues with lots of unicode characters, not sure what's at the bottom because the alert box is bigger than my screen and I can't scroll on it
Does anyone else know what could be going on?
This error is caused by drupalforfirebug, disabling drupal for firebug should help. or else this patch should work.
Found it. Syntax error hiding at the top of mymodule.views.inc. There was some weird formatting before the opening PHP tag. Not sure why php --syntax-check mymodule.php didn't catch it (I copied mymodule.views.inc to mymodule.php so that I could run the syntax checker on it).

Android Webview - can't disable cache

I'm using webview in my app which is loading remote web page, which is then using socket.io (node.js) via xhr-pooling.
Problem is that I can't disable caching of received data through socket.io.
For example, every 10 seconds my node server does io.emit, and my webview receives it and saves it in:
/data/data/...../webviewCache
I do not want my webview anything to save, because as time passes number of those files is just rising and they aren't helping my app run faster...
I've tried:
browser.getSettings().setCacheMode(2); //(2 is LOAD_NO_CACHE)
browser.getSettings().setAppCacheEnabled(false);
but neither of those works. My webview is still saving files to the cache folder.
At this moment, I've set up timer which is emptying cache folder every 60 seconds but that's not solution I would like to release in production...
Am I missing something here or there is bug with disabling cache within android?
UPDATE 1: After whole day of debugging I've found out something interesting.
Logcat shows two interesting things: saveCacheFile and getCacheFile
Then I've decided once again to try turn off the cache...
browser.getSettings().setCacheMode(android.webkit.WebSettings.LOAD_NO_CACHE);
That actually caused that WebView wasn't loading files from cache anymore, but it was still saving them. Log cat says something like this:
saveCacheFile for url .../socket.io/1/xhr-polling/BLNN28E7S4PZJsy2pWaF?t=13537
So I believe actual question would be, how to prevent webview from SAVING cache files on every request.
How about adding random string in the query part of your URL? This trick works under some cases.
The only solution I found was to send "Cache-Control: no-store" in the HTTP response header.

Dreamweaver cs6 Spry validation

I have a textfield and a spry validation text field.
In the spry properties I changed the max chars value to 50, checked required and on blurr.
When I test the page I get all the error messages at once ("valure required", "exceeded max number of chars")and the textfield is not coloured. Looks good in the preview in dreamweaver.. but when I run itt in the browser it fails.
Any hints?
--FIXED--
I did not copy the spry assets folder to the testing server.. I only had it in my local site folder.
I have had a similar problem with the error messages, it is extremely frustrating. I eventually found a solution via http://cssmenumaker.com/dreamweaver-css-menu-extension - I would definitely recommend them.

ABCPdf - Unable to render HTML. Unable to load page

I'm using ABCPdf to convert HTML to a PDF. I'm using the method:
AddImageUrl()
This works fine in Dev and UAT, but on Production I continuously get the message:
Unable to render HTML. Unable to load
page
Anyone see this before? Need more info?
-Ev
I guess you are tying to do URL->pdf generation. It is difficult to directly to do URL->pdf conversion. We ended up URL-Save HTML in local folder ->read HTML and convert to PDF-> delete HTML file from folder - tricky approach but it works. The only flaw is that you need to give read/write permission on a folder on server. Its still better than decreasing security settings.
have you take a look at this http://www.itjungles.com/dotnet/abc2pdf-unable-to-render-html
The default timeout for abcpdf is 15 seconds. If the page is taking longer than 15 seconds, you will get this exception.
Add the line below just after object creation of the document to resolve the issue.
theDoc.XHtmlOptions.Timeout = 10000000;
I found by working backwards (removing elements) from a target html page that omitting the tag (of all things) created this error. also, calling localhost in the target url generated this error.
I have no idea what caused this error, but I stopped the scheduled task that was running, then restarted it and it's worked fnie ever since.

Resources