| Index: components/physical_web/webui/resources/physical_web.js
|
| diff --git a/components/physical_web/webui/resources/physical_web.js b/components/physical_web/webui/resources/physical_web.js
|
| index b050945951938506355bfc04751d0abe32defa84..86002dd5027c47f343ec945f5c6dc06e7bb474c9 100644
|
| --- a/components/physical_web/webui/resources/physical_web.js
|
| +++ b/components/physical_web/webui/resources/physical_web.js
|
| @@ -25,6 +25,8 @@ function renderTemplate(nearbyUrlsData) {
|
| // This is the javascript code that processes the template:
|
| jstProcess(new JsEvalContext(nearbyUrlsData), templateDiv);
|
|
|
| + assignImageLoadErrorHandlers();
|
| +
|
| let bodyContainer = $('body-container');
|
| bodyContainer.hidden = false;
|
| }
|
| @@ -41,4 +43,15 @@ function pushNearbyURLs(nearbyUrlsData) {
|
| renderTemplate(nearbyUrlsData);
|
| }
|
|
|
| +function assignImageLoadErrorHandlers() {
|
| + var pwIcons = document.querySelectorAll('.physicalWebIcon');
|
| + pwIcons.forEach(function(e) {
|
| + let img = e.getElementsByTagName('img')[0];
|
| + img.addEventListener('error', function() {
|
| + img.src =
|
| + 'chrome://physical-web/ic_link_grey600_36dp.png';
|
| + });
|
| + });
|
| +}
|
| +
|
| document.addEventListener('DOMContentLoaded', physicalWebPageLoaded);
|
|
|