Why doesn't a website display properly in Google Chrome normal mode but displays fine in Incognito mode and all other browsers? - google-chrome

In my end the webpage looks good but in my client's end the page doesn't load properly or just the vertical lines show up without the text and images.
Link to the website : http://www.krishnaprasad.me/Iadmire.html (Inactive now).
The website looks fine in all browsers for my client except Google Chrome that too in normal mode.
I've used Foundation 5 framework for developing this site. If it's an issue with browser's extensions/plugins at my client's side, can I automatically disable that?

Let's start with the easy part: You cannot disable a plugin or extension from within JavaScript (if that's what you meant by automatically disabling). The only way that I know of to disabling those is for the user to actually open the Extensions page in their Browser Settings and manually disable those.
You can, however, detect the presence of problematic plugins or extensions in JavaScript and, for example, redirect the user to another page where you ask them to disable those plugins.
I've taken a look at the page and I found the culprit: One of elements had an id of adcontent, which I am guessing is black-listed by either Chrome or one of the plugins.
I believe that if you could change that id to something else, and adjust the CSS appropriately, the issue should be fixed.

Related

Can I create a Chrome extension that shows several pages in one window?

I'd like to show several webpages in one Chrome window by either writing an app or an extension.
Genuine iframes won't do, because some webpages either disable loading in iframes, or otherwise problems with content-security-policy directives prevent this from working.
webview tags don't use the browser's extension set, or write to history and so on - they seem to be just kind of little browsers of their own.
App Windows would be nice if instead of having their own window, they could be embedded in a single host window.
What I'd like is several "iframe-like" components that act completely like a normal Chrome viewport from the loaded site's perspective, and upon which installed extensions work, etc. If I were able to install extensions inside a webview, that would work too.
Is there anything like this that I can use within a Chrome app or extension?

Google Chrome Element Inspector (Developer Tools) removes HTML element in my page

I am using WordPress and on the admin side when I use Google Chrome v.32 Element Inspector (Developer Tools) some of the elements in my HTML seems to be removed. But when I load my page without the Developer Tools all my elements are there.
I did not have this problem with the previous version of Google Chrome.
I cannot post the code here, first because it's way to long and second I am not allowed. But maybe others have experienced the same problem and others might even have the solution.
I know it is not my JavaScript because it is not even downloaded the script elements have been removed for some reason because of the Developer Tools being open.
Basically why when I have the Developer Tools open for a page that page as some of it's elements removed and when I re-load the page without Developer Tools everything is back to normal?
My bad. For some reason the emulator was open. And set like this:
All I had to do is unchecked "Spoof user agent".

How can I force a hard reload in Chrome for Android

In Chrome for desktop I have options in the dev tools to disable cache completely when dev tools are opened and I have the options to manually do a hard reload when long clicking on the reload button (with dev tools open).
Is there any such technique for Chrome for Android? I didn't find any setting.
What can I do when I want to force the browser to download some javascript or css file instead of using a cached one when developing?
I'm using window.location.reload(true) according to MDN (and this similar question) it forces page to reload from server.
You can execute this code in the browser by typing javascript:location.reload(true) in the address bar.
Viewing the page in incognito mode will disable the cache. It was the only way I could force a refresh on a stylesheet without manually clearing the cache through the settings.
Also an option:
Menu
Settings
Privacy
Clear Browsing Data
Check "Cache" and press "CLEAR"
and then reload the page.
You can use the Request Desktop Site option from the app menu (to the right of the address bar) which will force the page to reload.
Simply tap it, wait for the refresh, then deselect it.
Mentioning this because you mentioned "when developing".
You can control the mobile device via your Chrome Desktop Browser.
Visit chrome://inspect/#devices on your desktop. And Inspect the device that's connected to your desktop. Agree when asked for permission.
You should now see a full fledged Devtool window for the current page on mobile device.
Now, Use the hard reload shortcut (Cmd+Shift+R) on desktop to do hard reload on mobile device!
How to reset all data for a given URL / Website on Chrome Mobile for android:
1 - Open the Chrome menu, and tap on the "i (info)" icon
2 - tap "Site settings"
3 - Tap the trashcan icon
That's it, even the most deeply ensconsed service worker for that URL will now die.
Don't forget to make sure that the "Reduce data usage" setting is turned OFF, as it seems to download cached data (from Google servers?) even though your local cache is flushed.
I know this is an old question, but I found that the accepted answer didn't work for me.
An alternate solution would be to append the url with a new url parameter
such as website.com?a=1, website.com?a=2, etc.
If you have parameters already, of course, you would use an ampersand
i.e. website.com?q=test&a=1
As of 2018, from google help center (tested on Chrome 63) :
tap on the three dots menu ;
choose History > Clear browsing data ;
if needed, choose the time period (above the checklist) ;
uncheck all items but Cached images and files ;
proceed with Clear data and confirm.
As mentioned in another answer, incognito tabs are also of great use for development.
I found a solution that works, but it's ugly.
Connect the Android device to your PC with a USB cable and open Chrome on your desktop.
Right-click anywhere on a page and select "Inspect".
Click the three-dot menu and select "Remote devices" under the "More tools" menu:
In the panel that opens, select your device and then the "Inspect" button next to the name of the tab on your phone that needs to be refreshed:
In the window that opens, click the "Network" tab and check the "Disable cache" checkbox:
Reload the page on your phone or using the reload button in the DevTools window.
Note: if your phone doesn't appear in the device list:
make sure the USB connection is using File Transfer mode and isn't simply charging
try restarting ADB or run adb devices to see if the device is being detected
The only reliable way I've found that doesn't require plugging the phone in to a PC is as follows:
1. Force stop the Chrome app.
This must be done first, and you cannot re-open Chrome until you finish these steps. There are several ways to force stop. Most home launchers will let you get to "App info" by holding down your finger on the chrome icon and selecting an "i" icon. Alternately, you may be able to go to Android settings and simply search for "Chrome".
Once in "App info", select "Force stop" as shown below:
2. Clear Chrome's cache
Select "Storage" from the same screen:
Finally, select "Clear cache".
When you return to the Chrome app, the page should reload itself and serve a non-cached version.
Additionally, I found a site that makes it easy to test if you've cleared your cache: https://refreshyourcache.com/en/cache-test/
I am in no way affiliated with it. Note that the method to clear the cache mentioned on that site is in fact outdated and no longer valid.
Keyboard shortcuts such as Ctrl+Shift+R work on Android too, you just need a keyboard capable of sending these keys. I used Hacker's Keyboard
to send Ctrl+Shift+R, which did a hard reload on my phone.
Recent versions of Chrome cache very aggressively. Even cache-busting techniques such as "http://url?updated=datecode" stopped working. You must clear the cache or launch an incognito window every time (and make sure data-saver is off).
Remote Debugging allows you to use the desktop dev-tools:
https://developers.google.com/chrome-developer-tools/docs/remote-debugging
If its just the matter of included files, just add version after the path (?v=12345678)
<link rel="stylesheet" type="text/css" href="style.css?v=12345678" />
Whoever loads the page again will see changes.
Most of the answers were not working for me.
Here is a super simple working on my Galaxy S8 in august 2020:
Add "view-source:" just before your http:.... address, navigate trough there to the changed file if different than the html or index.
You will see the unchanged file. Refresh.
Done.
EDIT: This method has been deprecated in Google Chrome and will no longer work.
ORIGINAL ANSWER:
I was able to clear the cache (including subsequent xhr) using chrome://net-internals
Then click the little arrow in the top right
Select "clear cache" from that menu.
Here is another simple solution that may work when others fail:
Today, a fairly simple developer-side solution worked for me when the caching problem was a cached CSS file. In short: Create a temporary html file copy and browse to it to update the CSS cache.
This trick can refresh the CSS file, at least in Android's blue-globe-iconed default browser (but quite likely its twin, the official Chrome browser, too, and whatever other browsers we encounter on "smart"phones with their trend of aggressive caching).
Details:
At first I tried some of the fairly simple solutions shared here, but without success (for example clearing the recent history of the specific site, but not months and months of it). My latest CSS would however not be applied apon refresh. And that even though I had already employed the version-number-trick in the CSS file-call in the head section of the html which had helped me avoid these pesky aggressive cachings in the past. (example: link rel="stylesheet" href="style.css?v=001" where you upgrade this pseudo-version number every time you make a change to a CSS file, e.g. 001, 002, 003, 004... (should be done in every html file of the site))
This time (August 2019) the CSS file version number update no longer sufficed, nor did some of the simpler measures mentioned here work for me, or I couldn't even find access to some of them (on a borrowed android phone).
In the end I tried something relatively simple that finally solved the problem:
I made a copy of the site's index.html file giving it a different name (indexcopy.html), uploaded it, browsed to it on the Android device, then browsed back to the original page, refreshed it (with the refresh button left of the address bar), and voilĂ : This time the refresh of index.html finally worked.
Explanation: The latest CSS file version was now finally applied on Android when refreshing the html page in question because the cached copy of the CSS file had now been updated when the CSS file was called from a differently named temporary html page that did not exist anywhere in the browser history and that I could delete again afterwards. The aggressive caching apparently ignored the CSS URL and went instead by the HTML URL, even though it was the CSS file that needed to be updated in the cache.
Adding a parameter to url fool browser to load a new page. I wrote a fuction for that purpose:
function forceReload(){
function setUrlParams(url, key, value) {
url = url.split('?');
usp = new URLSearchParams(url[1]);
usp.set(key, value);
url[1] = usp.toString();
return url.join('?');
}
window.location.href =setUrlParams(window.location.href,'_t',Date.now());
}
And you just need to call it:
forceReload();
I've struggled with this for a CSS file that wouldn't refresh. But you can type the name of the CSS file itself into the address bar and refresh that. After that it's fine. Chrome on Android 8. Obviously that would be tiresome if you had more than a couple of files involved.
If that's an option, you can visit the (i.e. JavaScript) resource directly, reload a bunch of times, and that also triggers a hard reload for that resource. Then you can reload the actual page again.
Launch the Chrome Android app
Tap on the menu for more options.
Select Settings from the list of options.
Scroll down and tap on the Site Settings tab.
Within the Site Settings open the Data Stored tab.
Tap on the Site URL that you want to delete storage.
Hit on the Clear & reset command button.
refresh the website page.
there are few methods to force reload chrome on mobile device:
clear history (look above)
use remote debugging (look above)
request desktop site
disable "Lite mode"
open URL for .JS or .CSS then do normal reload.
In chrome,simply tick "Desktop site" and then remove tick!!

iPad Full-Screen Mode Allow Browsing

I would like to use apple-mobile-web-app-capable to allow a user to browse a website like a kiosk, without the navigation bar and the page fullscreen.
This works well until a link is clicked, then it opens Safari.
Is there any way to use this fullscreen mode and allow clicking of links without being taken to Safari?
I asked a similar question over on AskDifferent - Hiding URL Bar on iPad.
The answer I received there suggested distributing the web app's configuration file, which allows you to configure many more options. The end-user must agree to the profile installation, but having a controlled device will limit any frustration with this fact. The details of this were linked to in the above answer, but it appears to be broken now.
Alternatively, Chrome has a full screen browser mode that can be taken advantage of. Given a controlled device you could simply use the alternative browser.

.png images display in IE8 alone but not inside a page

It's been a while since I did serious web development. Now I meet a host of brand new problems I'm no longer familiar with..
I have some .png images for various icons in my web page. What I find is that whenever I edit these images, they stop working inside a page in IE8. That is, they (usually) display OK when I first open the page, then are replaced by the placeholder icon on refresh. Sometimes, some of the icons display and others, with the same src, don't.
My image tags are nothing fancy, typically:
<img src="images/misc/smallreport.png" alt="Report" />
When I right-click an icon in the page and select "properties", protocol, type, address and size are shown as "Not Available", and dimensions are incorrect (size of the placeholder, I bet).
If I open the images directly in IE (ie. not within the page), they work just fine.
I have used Paint.NET to edit the images, but have also tried saving them with Paint.
Right now, I am working right off the hard disk (ie. not through a web server). And, oh yes, none of this happens in Google Chrome.
What's going on here?
check the path to the file is correct - can we see the tag please.
Well, we learn something new every day..
I mentioned that I'm running this directly off the harddisk? Now, it turns out the html page (which I had gotten off a coworker) was blocked "to help protect my computer", as Windows does.
This is no big surprise, lots of files I'm working with originate on other computers, and I usually don't worry much about it (except with executables, which won't run until unblocked).
It seems, however, that when IE8 loads such a blocked HTML file, its security settings adjust somehow, and - well, I can only guess at the details, but as soon as I right-clicked the HTML file, selected Properties and clicked the "unblock" button, the problem went away.
Something similar happened to me once, I tried hard to find what was wrong, then I realized I was saving (from Photoshop) the file as PSD but with extension .png. Make sure you're not doing the same.
Also:
Clear temporary Internet files
Verify that the Show Pictures option has not been turned off
Make sure that the Toggle Images.exe Web accessory is not present and disabling images
Make sure that a third-party Internet security, firewall, or cookie-blocking program is not causing the problem
Enable the Auto-Select encoding option
Source
It might be that the website you have browse has a lack of support
for an IE browser. IE is a nightmare for all web developers & Web designers.
It might be the developer of that website didn't care for an IE display because
of IE issues. Perhaps IE is trying to create a web standard to increase their
sales and marketing strategy. That's why don't care the modern Web development standard.
Why Chrome or Firefox or Safari, it's a free anyway.