Fix handling of Javascript functions from Rewards WebUI pages
See original GitHub issue@bridiver noticed a few problems in the Rewards WebUI pages:
- We shouldn’t call
CallJavascriptFunctionUnsafe
. Instead, useWebUIMessageHandler::CallJavascriptFunction
orFireWebUIListener
, since those are safe alternatives. - We should call
IsJavascriptAllowed
instead ofCanCallJavascript
. - Ensure that we’re calling
AllowJavascript
correctly, per the docs in the header file. It’s sometimes not called when it should be and sometimes called when it shouldn’t be.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Handling common JavaScript problems - MDN Web Docs
Incorrectly using functions inside loops that iterate with a global variable (more generally "getting the scope wrong"). For example, in bad-for ...
Read more >Set up a JavaScript Firebase Cloud Messaging client app
Set up a JavaScript Firebase Cloud Messaging client app · On this page · Add and initialize the FCM SDK · Configure Web...
Read more >How to enable JavaScript in Windows - Microsoft Support
Click the Refresh button to refresh the page and run scripts. Click the Refresh button to refresh the page and run scripts. To...
Read more >Telerik Web UI Grid Overview Demo | Telerik UI for ASP.NET ...
Explore RadGrid demos to find out how Telerik's Datagrid control can help you with editing and fast loading of large data in your...
Read more >[WebUI] Execute JavaScript - Katalon Docs
Execute JavaScript on the currently selected frame or window. The provided script fragment will be executed as the body of an anonymous function....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
that call
isn’t going throw where
javascript
is the actual script to be executed. In what place couldn’t it find the function? that’s the crash place before any validationsGetMojomFrameInRenderer()->
. It would crash constantly and always the way you explain it. But in fact we cannot replicate that, we just see crashes from users.Right, because
CallJavascriptFunctionUnsafe
can’t find the named JS function “brave_rewards.statement” in the Android version of the rewards page. We really need to get a native version of the Rewards page for Android! 😄…although in this case the android page appears to provide that function, so there’s probably something more going on.