You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-13 08:02:38 +03:00
Allow react performance profiling on widget iframes.
This commit is contained in:
@@ -36,6 +36,7 @@ import WidgetUtils from '../../../WidgetUtils';
|
|||||||
import dis from '../../../dispatcher';
|
import dis from '../../../dispatcher';
|
||||||
|
|
||||||
const ALLOWED_APP_URL_SCHEMES = ['https:', 'http:'];
|
const ALLOWED_APP_URL_SCHEMES = ['https:', 'http:'];
|
||||||
|
const ENABLE_REACT_PERF = false;
|
||||||
|
|
||||||
export default class AppTile extends React.Component {
|
export default class AppTile extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
@@ -452,7 +453,11 @@ export default class AppTile extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_getSafeUrl() {
|
_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 = '';
|
let safeWidgetUrl = '';
|
||||||
if (ALLOWED_APP_URL_SCHEMES.indexOf(parsedWidgetUrl.protocol) !== -1) {
|
if (ALLOWED_APP_URL_SCHEMES.indexOf(parsedWidgetUrl.protocol) !== -1) {
|
||||||
safeWidgetUrl = url.format(parsedWidgetUrl);
|
safeWidgetUrl = url.format(parsedWidgetUrl);
|
||||||
|
|||||||
Reference in New Issue
Block a user