How to trigger the "yellow prompt" in Google Chrome or Chromium? - javascript

Sometimes while browsing websites using Chrome, you can see a yellow prompt showup. How can I trigger that prompt for my own websites?
For example try going to the The Independent's website and you will be prompted "The Independent now has a Google Chrome Extension. Get the latest news on the topics you like, direct to your browser."
I have previously seen this prompt on Google.com as well, however I assumed that that was something internal for google only websites. This is the first time I have seen the prompt for Non-Google owned websites.

It's a custom look-a-like they've made. Take a look at their javascript file here: http://www.independent.co.uk/independent.co.uk/editorial/javascript/tb.js
It does most of the work. You might be able to get some ideas from there :)

I assume you need to check this question: Chrome - Notify User to install your extension
Looks like there are no standard API for defining extension available for particular site – so you need to imitate such behavior with JS.
If I made a mistake, feel free to correct me in comments.

You are looking for the Infobars API, but this feature is only available for extensions.

Related

How can I get installed chrome extensions list with javascript

I have a web site made by Python Django.
And I want to check if a visitor's chrome browser's chrome extension is installed.
I found some information, it looks possible with Javascript.
https://www.python2.net/questions-993829.htm
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/management/getAll
They say you can get all installed chrome extensions by writing it like this.
chrome.management.getAll() or brower.management.getAll()
But When I tried that "chrome.management" is not defined.
Is it need to add library to use chrome.management?
I read the API documents, But I didn't know How can I to do.
Please teach me if you know about this. Thank you.
From the looks of chromes docs (https://developer.chrome.com/docs/extensions/reference/management/), it seems that chrome.management is only able to be used in chrome extensions with the management permission. There doesn't seem to be any real alternative for websites. (Although if you own the extension you might be able to create a hidden div with a specific id, then the website could detect that).
If chrome did allow websites to see this it would also make fingerprinting much easier.

How can I link to a chrome extension in Chrome Web Store when I'm not the developer?

I've seen the "How to link to chrome extension like Chrome Web Store?" question from Oct. 2011, and I tried to implement it.
However, I realized after some testing that the approach described in answer to that question regarding Inline Installation only works in situations where the original developer of the extension links to his own creation in the Chrome Web Store.
I have a daily podcast that I post to my website, and I want to provide a one-click link for Chrome users to click in order to install The RSS Aggregator extension (which I did NOT develop) directly, so that desktop visitors using Chrome can view my podcast feed in a formatted page rather than just seeing XML code.
Since I'm not the original creator of The RSS Aggregator extension, I don't see a way for me to accomplish this.
For the moment, I'm sending visitors to the Chrome Web Store to install it there, but I've been getting feedback from tech-averse visitors that they can't figure out how to install it without step-by-step installation instructions. Sadly, there are still a lot of people out there who have trouble handling something as simple as adding an extension to their Chrome browsers.
Hence my desire to provide a one-click solution on my site.
Is there a way I can implement a solution on my site?
Never used it before, but maybe this helps you:
https://developer.chrome.com/webstore/inline_installation#cws-link

Native toast message on browser

Can you help me give a library that have notification feature like on Web Slack and Web Skype that can notify user even if he/she is not on your site page.
Thanks, sorry for the title I dont know what type of notification this is.
This is either a chrome extension or a native app, a browser window can't normally access other windows
Their documentation sucks, I would recommend just searching around stack overflow
https://developer.chrome.com/extensions/api_index
https://developer.chrome.com/extensions/tabs
If, by the chance this is actually a new thing, it would be called a web-worker, which is a long running process behind the scenes. Likely, it's a background script which uses some chrome API
I know this question was asked ages ago, but this turned up when I googled a similar question. So thought I would share the correct links...
The official documentation for this is:
Chrome
https://developers.google.com/web/fundamentals/push-notifications/
Safari
https://developer.apple.com/notifications/safari-push-notifications/
Firefox
https://developer.mozilla.org/en-US/docs/Web/API/Push_API

How Can I Spoof A Different Location In My Browser for Testing?

I couldn't find this in the linked questions above.
I have written a JS Web app that uses Google Maps. I'm getting reports from India that the browser location isn't being found on the mobile version of the app, and I need to be able to debug it (I live in New York).
It works fine in the NY installation, so I need to test on the Indian installation.
The problem is that I need my browser to report a local long/lat, so I can trigger that JS code path.
Is there a way to get my browser to spoof a long/lat?
This is the only thing I've found. It looks fiendishly complex, rather delicate, and I'm not sure it would work for my application.
Is there a more straightforward way for me to do something like supply a GPX file (like I do for Xcode) to spoof a location?
I am using a Mac, and can use pretty much any browser to do this.
Thanks!
OK. I figured out how to do this in Chrome.
It is almost the same as this (The solution I mentioned in the question).
However, Google seems to have moved things around. You no longer have the "Emulation" tab. What you have is a "Sensors" tab that appears in the second Developer panel:
In here, you can play with it.

what is the meaning of google_experiment_mod in chrome localstorage

I am storing some items in chrome local storage. Along with my variables I can see
google_experiment_mod: "335"
I am wondering what it means.
Below is the code to to store the items and I use chrome developer tool to see the content.
localStorage.setItem("freqInMins", response.freqInMins);
Thanks
google_experiment_mod is used by Google AdSense for experimenting with which advertisement perform best on a website. Please refer to “How Google uses data when you use our partners’ sites”.
I have that too under the web inspector, but only on certain sites. I use mac and I am using Safari. I also found while searching "experiments" in the resource content on the google homepage something that says "dnssec-nd.gexperiments1.com", so I'm guessing that "gexperiments" means "googleexperiments" , and its probably something google uses to track everyone's time or something like that. so its probably nothing.

Categories

Resources