Hello,
When ‘Rocket Loader’ is enabled the Google Search Bar widget on the website disappear.
Didn’t get an error message at the dev console.
Did anyone encounter the same and was able to fix it?
Thanks,
Hello,
When ‘Rocket Loader’ is enabled the Google Search Bar widget on the website disappear.
Didn’t get an error message at the dev console.
Did anyone encounter the same and was able to fix it?
Thanks,
I don’t know about the Google search bar widget in particular, but you can try setting it so that Rocket Loader ignores that script. The other option would be to contact support.
Thanks for your reply, I tried to exclude the script as explained in the link you sent but still Google search bar won’t show up.
Here is what I did:
script async data-cfasync=“false” src=“https://cse.google.com/cse.js?cx=partner-pub-1234567890:1234567890”
(Added after async: data-cfasync=“false”, marked in bold)
Hmmm… I would try inserting the attribute before (or in place of) the ‘async’ that was already there.
If the search bar shows up after trying both, test to see which performs better.
If nothing works, you may need to contact support about it.
Edit: Make sure you’re purging cache (on Cloudflare and any other cache you have) after any change.
Suddenly it started showing the search bar, I kept the original code as mentioned in the previous message.
Yes purged the cache both on CF and the website, maybe it needed a few minutes…
Thanks again for your help
Just an update, the search bar disappears on refresh or revisiting the page.
Are you sure there’s nothing about it in dev tools in your browser? Not necessarily an error message in the console part, but you should see the request (and response) for that .js file in the network tab. That response will tell you a lot about why it’s failing.
Couldn’t find anything that looks suspicious, here’s a screenshot of the problem: 2021-07-24_11-27-38.mp4 - Google Drive
What is the response when you click on cse.js in that list?
Here’s a screenshot of what I found different in dev tools. Left of the screenshot the search bar was loading successfully on first load (incognito). Right side of the screenshot is after page refresh, the search bar disappeared. I marked in red the lines which don’t appear when the search bar doesn’t load.
We need to see the response from cse.js to know what’s happening. You should be able to scroll down that ‘Name’ tab on the left, click cse.js and then view the response tab for that file (you’re on ‘initiator’ tab in these screenshots).
Unless there’s more below (line 17+) in the response?
But first look at the ‘headers’ tab and copy/paste that here. That’s where any errors should show up much easier to see.
I compared the response tab after line 17, it is identical. Same for the header it is identical in both cases, here is the header when the search bar doesn’t appear:
- Request URL:
https://cse.google.com/cse.js?cx=partner-pub-3970437467656641:6223239079
- Request Method:
GET
- Status Code:
200
- Remote Address:
142.250.76.206:443
- Referrer Policy:
strict-origin-when-cross-origin
Response Headers
alt-svc:
h3=“:443”; ma=2592000,h3-29=“:443”; ma=2592000,h3-T051=“:443”; ma=2592000,h3-Q050=“:443”; ma=2592000,h3-Q046=“:443”; ma=2592000,h3-Q043=“:443”; ma=2592000,quic=“:443”; ma=2592000; v=“46,43”
- bfcache-opt-in:
unload
- content-disposition:
attachment; filename=“f.txt”
- content-encoding:
br
- content-length:
3487
- content-type:
text/javascript; charset=UTF-8
- date:
Sun, 25 Jul 2021 04:15:31 GMT
- server:
gws
- x-frame-options:
SAMEORIGIN
- x-xss-protection:
0
Request Headers
:authority:
- :method:
GET
- :path:
/cse.js?cx=partner-pub-3970437467656641:6223239079
- :scheme:
https
- accept:
3./*
- accept-encoding:
gzip, deflate, br
- accept-language:
en-US,en;q=0.9
- referer:
- sec-ch-ua:
" Not;A Brand";v=“99”, “Google Chrome”;v=“91”, “Chromium”;v=“91”
- sec-ch-ua-mobile:
?0
- sec-fetch-dest:
script
- sec-fetch-mode:
no-cors
- sec-fetch-site:
cross-site
- user-agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36
If the header is identical in both cases, I think it must be served from disk/memory cache. I’m not 100% sure on that. I had a look at your site and I can’t work it out. It’s only a guess, but I’d say Rocket Loader is interfering with what this bfcache is trying to do:
- bfcache-opt-in:
unload
@MoreHelp Ticket #2213937, Google search bar doesn’t appear when Rocket Loader is enabled.
To reproduce the issue here are the steps:
@drawingnow you have an error in your Javascript code:
html5player.min.js?v=ef674cc993e9b1aa16300c8099545492:687 Uncaught TypeError: Cannot read property '2' of null
at HTML5Player.init (html5player.min.js?v=ef674cc993e9b1aa16300c8099545492:687)
at HTML5Player.<anonymous> (html5player.min.js?v=ef674cc993e9b1aa16300c8099545492:845)
Can you fix this? It may be that Rocket Loader is bailing out after this error, causing the issue.
Hi Simon, I removed the errors, please follow the steps to reproduce the issue:
Given there’s no errors and it’s hard to see what is different here. Now you’ve resolved your other errors - can you try putting the script back in so that Rocket Loader will load it?
Rocket Loader and Google search Bar are enabled, please see DrawingNow - Learn How to Draw