chromium / suspicious-site-reporter

Extension for reporting suspicious sites to Safe Browsing.
Apache License 2.0
95 stars 22 forks source link

Referrer UI should be hidden if API unavailable #35

Open ericlaw1979 opened 5 years ago

ericlaw1979 commented 5 years ago

I've noticed that when running in non-Chrome browsers, the Referrer Chain appears to always be empty and the preview that appears when clicked is confusing (it looks like a tooltip, but it's meant to show a list). image

It seems like the preview should explicitly say something (like "None") when the referrer list is blank, and in browsers where the private API isn't available perhaps this entire area of the popup should be removed?

livvielin commented 5 years ago

Currently in older versions of Chrome that don't have the API, or from custom builds with a different extension ID, there is a special bubble (https://github.com/chromium/suspicious-site-reporter/blob/master/extension/popup.js#L202), whereas empty referrer chains should have a bubble that says 'No referrer found' (https://github.com/chromium/suspicious-site-reporter/blob/master/extension/popup.js#L198). I wonder if the bug here specific to non-Chrome browsers is that the (chrome.safeBrowsingPrivate && chrome.safeBrowsingPrivate.getReferrerChain) check errors out and the whole function call fails?