Allow react performance profiling on widget iframes.

pull/21833/head
Richard Lewis 2018-03-16 10:20:14 +00:00
parent 83412acbe7
commit 4d8f5072f7
1 changed files with 6 additions and 1 deletions

View File

@ -36,6 +36,7 @@ import WidgetUtils from '../../../WidgetUtils';
import dis from '../../../dispatcher';
const ALLOWED_APP_URL_SCHEMES = ['https:', 'http:'];
const ENABLE_REACT_PERF = false;
export default class AppTile extends React.Component {
constructor(props) {
@ -452,7 +453,11 @@ export default class AppTile extends React.Component {
}
_getSafeUrl() {
const parsedWidgetUrl = url.parse(this.state.widgetUrl);
const parsedWidgetUrl = url.parse(this.state.widgetUrl, true);
if (ENABLE_REACT_PERF) {
parsedWidgetUrl.search = null;
parsedWidgetUrl.query.react_perf = true;
}
let safeWidgetUrl = '';
if (ALLOWED_APP_URL_SCHEMES.indexOf(parsedWidgetUrl.protocol) !== -1) {
safeWidgetUrl = url.format(parsedWidgetUrl);