Execute Javascript method from browser address bar - GWT

后端 未结 2 1281
情歌与酒
情歌与酒 2021-02-05 13:12

I\'m trying to execute Javascript on my web application by executing this on the browser URL/address bar:

javascript:window.alert(\'test\');void(0);
2条回答
  •  暖寄归人
    2021-02-05 14:12

    I believe most browsers refuse to execute javascript: URLs from the URL bar as a safety measure (there's been messages on the web –esp. Facebook– telling people to copy-paste a javascript: URL to their URL bar that triggered an XSS). They didn't want to break bookmarklets though, so you can put that code in a bookmark; but it's much easier to just open the browser's JS console and type that command there.

    Anyway, it's not due to GWT's DevMode.

提交回复
热议问题