Using the function below I am trying to get the LAST url that the user visited from Chrome Browser on their Android Phone. This function works very well for most sites, but does not work for "www.reddit.com".
The url
variable below updates if I go to "www.google.com", "www.hulu.com" or "www.kayak.com" but will not update if I go to "www.reddit.com".
It does update if I go to "m.reddit.com". Same problem with facebook, detects m.facebook.com but not www.facebook.com.
I don't understand What's the difference between "www.reddit.com" and "m.reddit.com" that Android records one but not the other.
What change do I need in the code to detect ALL URL ACCESSES?
public String returnLastChromeURL(int browserCode) { String[] proj = new String[] { Browser.BookmarkColumns.DATE, Browser.BookmarkColumns.TITLE, Browser.BookmarkColumns.URL }; String dateTime; Uri uriCustom = Uri .parse("content://com.android.chrome.browser/bookmarks"); String sel = Browser.BookmarkColumns.BOOKMARK + " = 0"; // 0 = history, // 1 = bookmark try { Cursor mCur = mContext.getContentResolver().query(uriCustom, proj, sel, null, BookmarkColumns.DATE + " ASC"); mCur.moveToFirst(); mCur.moveToLast(); dateTime = mCur.getString(mCur .getColumnIndex(Browser.BookmarkColumns.DATE)); title = mCur.getString(mCur .getColumnIndex(Browser.BookmarkColumns.TITLE)); url = mCur.getString(mCur .getColumnIndex(Browser.BookmarkColumns.URL)); mCur.close(); } catch (Exception e) { dateTime = String.valueOf(System.currentTimeMillis()); title = ""; url = "empty_list"; } return url; }
Some more info from my debug:
www.reddit.com
get detected ok). On a real phone www.reddit.com
does not get detected.www.kayak.com' (redirects to
www.kayak.com/mn),
www.hulu.com(loads mobile version of site though url stays www.hulu.com),
www.google.com` (same story as the hulu).Seems like that the sites that load the pure desktop version of the site, do not get detected
Click on Chrome Menu button and select Extensions from Tools. In the Extensions page, look for the extension History Site Blocker and click on the Options link next to it. All you need to do now is write down the full root level URL of the website you want to remove from the browser history tracer.
Why is my Google search history showing up on other devices? The Google search history or the browsing history and bookmarks will appear on other devices if the browsers are synced. Or, you are using the same Google account for both devices.
Your Chrome history has disappeared if the browser settings related to history weren't correct. To restore the history in Chrome, you can try to check the User data folder for previous versions. Switch to another browser and prevent this problem from happening again.
In the Google settings page, tap Search. Now under Privacy & accounts, look for the “Show recent searches” setting and uncheck the box next to it. That's all! You should no longer see recent Google searches on your Android device.
This is because you never visit the desktop domain on your mobile , actually each time you visit facebook on your mobile ( or any other website that detects your navigator ) it will automatically redirects you to the mobile website , redirections will not be saved in history unless page loads , which never happens.
Check the following screenshot taken from my true N7100 galaxy note2 and my windows browser :
if you are using chrome browser you can request desktop website ( which is not a reliable solution as user will have to do this manually ).
another solution is to override redirection method which will not work due to XSS policy.
so a better solution is to fake your browser and convince the server that you are using a desktop browser check this answer .
The simulator on desktop uses device user agent which will count as desktop browser.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With