Bug 173712 - [WPE] User script messages don't work
Summary: [WPE] User script messages don't work
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WPE WebKit (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 173757
  Show dependency treegraph
 
Reported: 2017-06-22 06:35 PDT by Carlos Garcia Campos
Modified: 2017-06-23 04:11 PDT (History)
3 users (show)

See Also:


Attachments
Patch (16.32 KB, patch)
2017-06-22 06:51 PDT, Carlos Garcia Campos
sam: review-
Details | Formatted Diff | Diff
Patch (18.51 KB, patch)
2017-06-22 08:44 PDT, Carlos Garcia Campos
zan: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2017-06-22 06:35:50 PDT
The main reason why it doesn't work is because it's disabled in the build, but even enabling them, we don't have a way in WPE to get the js global context from the WebScriptMessageHandler client.
Comment 1 Carlos Garcia Campos 2017-06-22 06:37:54 PDT
TEST: bin/TestWebKitAPI/WPE/TestWebKitUserContentManager... (pid=22808)
  /wpe/WebKitWebView/new-with-user-content-manager:                    OK
  /wpe/WebKitUserContentManager/injected-style-sheet:                  Error sending IPC message: Connection reset by peer
OK
  /wpe/WebKitUserContentManager/injected-script:                       Error sending IPC message: Connection reset by peer
OK
  /wpe/WebKitUserContentManager/script-message-received:               **
ERROR:/home/cgarcia/src/git/gnome/WebKit-WPE/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitUserContentManager.cpp:270:void testUserContentManagerScriptMessageReceived(UserScriptMessageTest*, gconstpointer): assertion failed: (javascriptResult)
FAIL
GTester: last random seed: R02S2dfde0838a0fd6b1ed62f08b98a8a639
(pid=22917)
FAIL: bin/TestWebKitAPI/WPE/TestWebKitUserContentManager
Comment 2 Carlos Garcia Campos 2017-06-22 06:51:49 PDT
Created attachment 313613 [details]
Patch
Comment 3 Sam Weinig 2017-06-22 07:40:40 PDT
Comment on attachment 313613 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=313613&action=review

> Source/WebKit2/UIProcess/WebPageProxy.h:641
> +#if PLATFORM(WPE)
> +    WKWPE::View& view();
> +#endif

Please don't add view accessors to WebPageProxy, we have been working to remove the ones in the cocoa platform.  Instead please add PageClient functions for the functionality you need.
Comment 4 Carlos Garcia Campos 2017-06-22 08:36:11 PDT
(In reply to Sam Weinig from comment #3)
> Comment on attachment 313613 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=313613&action=review
> 
> > Source/WebKit2/UIProcess/WebPageProxy.h:641
> > +#if PLATFORM(WPE)
> > +    WKWPE::View& view();
> > +#endif
> 
> Please don't add view accessors to WebPageProxy, we have been working to
> remove the ones in the cocoa platform.  Instead please add PageClient
> functions for the functionality you need.

Sure, I didn't know that
Comment 5 Carlos Garcia Campos 2017-06-22 08:44:27 PDT
Created attachment 313628 [details]
Patch
Comment 6 Carlos Garcia Campos 2017-06-23 04:11:35 PDT
Committed r218740: <http://trac.webkit.org/changeset/218740>