mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
On Firefox, Angular DevTools was breaking the XML display because of the script injected Based on contentType, we won't inject that script anymore Fixes #48017 PR Close #48021
22 lines
680 B
TypeScript
22 lines
680 B
TypeScript
/**
|
|
* @license
|
|
* Copyright Google LLC All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
* found in the LICENSE file at https://angular.io/license
|
|
*/
|
|
|
|
/// <reference types="chrome"/>
|
|
|
|
window.addEventListener('message', (event: MessageEvent) => {
|
|
if (event.source === window && event.data) {
|
|
chrome.runtime.sendMessage(event.data);
|
|
}
|
|
});
|
|
|
|
if (document.contentType === 'text/html') {
|
|
const script = document.createElement('script');
|
|
script.src = chrome.runtime.getURL('app/detect_angular_for_extension_icon_bundle.js');
|
|
document.documentElement.appendChild(script);
|
|
document.documentElement.removeChild(script);
|
|
}
|