Git Product home page Git Product logo

cog's Introduction

Cog

Cog (boat)

Build - Native Build - ARM Code Style

Cog is a small single “window” launcher for the WebKit WPE port. It is small, provides no user interface, and is suitable to be used as a Web application container. The “window” may be fullscreen depending on the WPE backend being used.

This project provides the following components:

  • libcogcore is a library with ready-to-use components typically needed for implementing applications which use the WPE WebKit API.

  • cog is the launcher itself, implemented using the libcogcore library.

  • cogctl is a tool which can be used to control a cog instance using the D-Bus session bus.

It is possible to disable building the cog and cogctl programs by passing -Dprograms=false to Meson.

Dependencies

Stable releases have the following dependencies:

  • WPE WebKit 2.28.x
  • WPEBackend-fdo 1.8.x (optional, recommended)

Note that building from the master branch will often require development releases of WPE WebKit, libwpe, and WPEBackend-fdo; while older Cog releases may have different version requirements.

Using Cog

Compiling Cog follows the usual procedure for projects which use Meson: meson setup build && ninja -C build should get you started, if your system has the needed dependencies installed.

Documentation is available at igalia.github.io/cog but it is currently incomplete. Contributions in this regard are very welcome.

Bug tracking: If you have found a bug, take a look at out issue tracker. Please see the “reporting bugs” section in the CONTRIBUTING.md file for guidelines on how to provide a good bug report.

Contributing

For information on how to report bugs, or how to contribute to Cog, please check the CONTRIBUTING.md file.

License

This project is licensed under the terms of the MIT license. Check the COPYING file for details.

cog's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cog's Issues

Attempting to build cog against trunk I got this error since yesterday:

Attempting to build cog against trunk I got this error since yesterday:

| FAILED: CMakeFiles/cog.dir/cog.c.o
| /home/igalia/psaavedra/yocto-wandboard-wpe/builds/wandboard-mesa-wpe-nightly/tmp/work/armv7at2hf-neon-poky-linux-gnueabi/cog/gitAUTOINC-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc -DCOG_INSIDE_COG__=1 -DG_LOG_DOMAIN=\"Cog\" -I. -I/home/igalia/psaavedra/yocto-wandboard-wpe/builds/wandboard-mesa-wpe-nightly/tmp/work/armv7at2hf-neon-poky-linux-gnueabi/cog/gitAUTOINC-r0/git/core -I/home/igalia/psaavedra/yocto-wandboard-wpe/builds/wandboard-mesa-wpe-nightly/tmp/work/armv7at2hf-neon-poky-linux-gnueabi/cog/gitAUTOINC-r0/recipe-sysroot/usr/include/wpe-webkit-0.1 -I/home/igalia/psaavedra/yocto-wandboard-wpe/builds/wandboard-mesa-wpe-nightly/tmp/work/armv7at2hf-neon-poky-linux-gnueabi/cog/gitAUTOINC-r0/recipe-sysroot/usr/include/libsoup-2.4 -I/home/igalia/psaavedra/yocto-wandboard-wpe/builds/wandboard-mesa-wpe-nightly/tmp/work/armv7at2hf-neon-poky-linux-gnueabi/cog/gitAUTOINC-r0/recipe-sysroot/usr/include/libxml2 -I/home/igalia/psaavedra/yocto-wandboard-wpe/builds/wandboard-mesa-wpe-nightly/tmp/work/armv7at2hf-neon-poky-linux-gnueabi/cog/gitAUTOINC-r0/recipe-sysroot/usr/include/glib-2.0 -I/home/igalia/psaavedra/yocto-wandboard-wpe/builds/wandboard-mesa-wpe-nightly/tmp/work/armv7at2hf-neon-poky-linux-gnueabi/cog/gitAUTOINC-r0/recipe-sysroot/usr/lib/glib-2.0/include -I/home/igalia/psaavedra/yocto-wandboard-wpe/builds/wandboard-mesa-wpe-nightly/tmp/work/armv7at2hf-neon-poky-linux-gnueabi/cog/gitAUTOINC-r0/recipe-sysroot/usr/include/wpe-0.2 -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security  --sysroot=/home/igalia/psaavedra/yocto-wandboard-wpe/builds/wandboard-mesa-wpe-nightly/tmp/work/armv7at2hf-neon-poky-linux-gnueabi/cog/gitAUTOINC-r0/recipe-sysroot  -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/home/igalia/psaavedra/yocto-wandboard-wpe/builds/wandboard-mesa-wpe-nightly/tmp/work/armv7at2hf-neon-poky-linux-gnueabi/cog/gitAUTOINC-r0=/usr/src/debug/cog/gitAUTOINC-r0 -fdebug-prefix-map=/home/igalia/psaavedra/yocto-wandboard-wpe/builds/wandboard-mesa-wpe-nightly/tmp/work/armv7at2hf-neon-poky-linux-gnueabi/cog/gitAUTOINC-r0/recipe-sysroot= -fdebug-prefix-map=/home/igalia/psaavedra/yocto-wandboard-wpe/builds/wandboard-mesa-wpe-nightly/tmp/work/armv7at2hf-neon-poky-linux-gnueabi/cog/gitAUTOINC-r0/recipe-sysroot-native=   -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security  --sysroot=/home/igalia/psaavedra/yocto-wandboard-wpe/builds/wandboard-mesa-wpe-nightly/tmp/work/armv7at2hf-neon-poky-linux-gnueabi/cog/gitAUTOINC-r0/recipe-sysroot   -pthread -std=gnu99 -MD -MT CMakeFiles/cog.dir/cog.c.o -MF CMakeFiles/cog.dir/cog.c.o.d -o CMakeFiles/cog.dir/cog.c.o   -c /home/igalia/psaavedra/yocto-wandboard-wpe/builds/wandboard-mesa-wpe-nightly/tmp/work/armv7at2hf-neon-poky-linux-gnueabi/cog/gitAUTOINC-r0/git/cog.c
| In file included from /home/igalia/psaavedra/yocto-wandboard-wpe/builds/wandboard-mesa-wpe-nightly/tmp/work/armv7at2hf-neon-poky-linux-gnueabi/cog/gitAUTOINC-r0/recipe-sysroot/usr/include/wpe-webkit-0.1/wpe/webkit.h:72,
|                  from /home/igalia/psaavedra/yocto-wandboard-wpe/builds/wandboard-mesa-wpe-nightly/tmp/work/armv7at2hf-neon-poky-linux-gnueabi/cog/gitAUTOINC-r0/git/core/cog-webkit-utils.h:20,
|                  from /home/igalia/psaavedra/yocto-wandboard-wpe/builds/wandboard-mesa-wpe-nightly/tmp/work/armv7at2hf-neon-poky-linux-gnueabi/cog/gitAUTOINC-r0/git/core/cog.h:15,
|                  from /home/igalia/psaavedra/yocto-wandboard-wpe/builds/wandboard-mesa-wpe-nightly/tmp/work/armv7at2hf-neon-poky-linux-gnueabi/cog/gitAUTOINC-r0/git/cog.c:12:
| /home/igalia/psaavedra/yocto-wandboard-wpe/builds/wandboard-mesa-wpe-nightly/tmp/work/armv7at2hf-neon-poky-linux-gnueabi/cog/gitAUTOINC-r0/recipe-sysroot/usr/include/wpe-webkit-0.1/wpe/WebKitUserContentFilterStore.h:27:2: error: #error "Only <webkit2/webkit2.h> can be included directly."
|  #error "Only <webkit2/webkit2.h> can be included directly."
|   ^~~~~
| /home/igalia/psaavedra/yocto-wandboard-wpe/builds/wandboard-mesa-wpe-nightly/tmp/work/armv7at2hf-neon-poky-linux-gnueabi/cog/gitAUTOINC-r0/recipe-sysroot/usr/include/wpe-webkit-0.1/wpe/WebKitUserContentFilterStore.h:34:10: fatal error: webkit2/WebKitDefines.h: No such file or directory
|  #include <webkit2/WebKitDefines.h>
|           ^~~~~~~~~~~~~~~~~~~~~~~~~
| compilation terminated.

Install platform modules into a Cog-specific libdir

Instead of installing platforms modules (e.g. libcogplatform-fdo.so) into $PREFIX/lib/ as if they were shared libraries, we should be installing them into their own subdir, e.g. $PREFIX/lib/cog-$APIVERSION/.

Setup continuous integration

The plan for this is to use a CI provider that integrates with GitHub and supports using custom container images. Then we can provide base images which already include builds of WPEBackend, WPEBackend-fdo, and WPE WebKit. The following CI services look good for this approach:

Both are free of charge for Open Source projects. I am leaning towards Cirrus because it allows configuring it with a YAML file inside the repository and it will build PRs by default as well, which makes the workflow quite similar to the very popular Travis-CI.

Support using a configuration file

Some ideas and notes on how this could be (IMHO) nicely done:

  • Of course, CLI options override the options loaded from the configuration file.
  • We can use GKeyFile for parsing the configuration file (no need to reinvent!)
  • As done in #29 for CLI options that apply to WebKitSettings, we could derive the keys allowed in the configuration file from GObject properties.
  • We can have multiple sections for the configuration file, with each section mapping to the GObject properties of a certain class, e.g. [websettings] applies to the properties of WebKitSettings, [general] could apply to CogSettings (which of course does not exist at the moment), and so on.

Support multiple web views simultaneously

Currently Cog supports only a single web view, and it would be interesting to provide support for more than one. In my mind, the minimum that needs to be done is:

  • Allow CogShell to contain more than a single web view, one of them considered to be the “active” one.
  • Augment the platform plug-in interface to:
    • Request from the platform plug-in more than one view backend.
    • Letting the platform plug-in know which view (and hence view backend) is active.
  • Add new API to CogShell to:
    • Enumerate web views.
    • Check which view is the active one.
    • Select which view is the active one.
  • Expose multiple web view support in CogLauncher.
  • Add commands to cogctl for managing multiple web views.
  • Port/add platform implementations to the new API:
    • FDO (Wayland)
    • DRM (Kernel Mode Setting + Direct Rendering Manager).
    • Simple (only one view supported, fallback for basic WPE backends like the RDK one).

The simplest implementation (on the platform plug-in side) would be to only display frames coming from the active view, and keeping around the most recent frame from the other views, so it can be used as the first frame shown when the active view is changed.

There is one problem: when using the fall-back WPE “default” view backend (that is: no platform plug-in is used), we cannot know what the WPE backend implementation will do, therefore in that case I think the safest approach would be disallow creating more than one web view.

Cog memory leak

Hello!

I am experiencing a memory leak in Cog. It's memory usage grows by about 25 MB/hour. The attached graph shows the available system memory along with with the memory consumed by Cog, WPEWebProcess and WPENetworkProcess individually, over a period of about 20 hours.

cog-memory

I am running a Qualcomm Snapdragon SD-410, with the latest Cog and WPE from meta-webkit as of yesterday (b12d42). This means commit 063df1 of Cog and version 2.22.0-r0 of WPEWebKit.

I am starting cog with these variables and arguments

[Service]
Environment=XDG_RUNTIME_DIR=/data/xdg_runtime_dir
Environment=COG_PLATFORM_FDO_VIEW_FULLSCREEN=1
Environment=WEBKIT_INSPECTOR_SERVER=0.0.0.0:2999
Environment=WPE_RAM_SIZE=128m
Environment=WPE_POLL_MAX_MEMORY=databaseprocess:50m,networkprocess:100m,webprocess:300m,rpcprocess:50m
Environment=MSE_MAX_BUFFER_SIZE=audio:2m,video:15m,text:1m
ExecStart=/usr/bin/cog -P fdo --enable-write-console-messages-to-stdout=true <url>

The page being displayed is of relatively low-resolution images scrolling horizontally using canvas, but the issue has also been observed when using css transforms.

Any help in finding the source of this problem is greatly appreciated!

Segmentation fault on Buildroot -branch next / RPi3B+

I'm getting a Segmentation fault when trying to launch cog. I've built for a RPi3B+ using Buildroot's next branch. Wayland launches successfully, then the error occurs when launching cog in a second SSH session.

SSH1

export XDG_RUNTIME_DIR=run/user
chmod 0700 run/user
weston --backend=fbdev-backend.so --tty=1 --device=/dev/fb0

# Launches Weston/Wayland successfully

SSH2

export XDG_RUNTIME_DIR=run/user
cog -P fdo http://google.com

# Fails
Wayland: Got a wl_compositor interface
Wayland: Got an xdg_shell interface
Wayland: Got a wl_shell interface
Segmentation fault

Versions are:

  • cog-v0.2.0
  • wpewebkit-2.22.4
  • wpebackend-fdo-1.0.1

I've attached Buildroot's .config if that's any help.

Fullscreen support

It would be nice to have a command-line option for this. And also one to be able to specify the default window size.

Project version in CMake is outdated

Currently hardcoded to 0.1.0. Should be 0.3.2 ? Would be nice to have an indication at runtime that we run a git snapshot or not, using cog --version.

Cog fails to render local html file.

When I start cog with a local file as the url I get the raw html text instead of the rendered html.

This is how I'm launching cog:

/bin/cog --platform=fdo file:///var/www/frontend/index.html

Is this a bug or am I launching cog with the wrong options?

Support white/black listing which domains/URIs that can be accessed

This would be useful for hardening Cog in installations where only fixed set of services is allowed to be used. Enforcing this would reduce the risk e.g. of accidentally leaking information to servers outside of the allowed set.

While the best way to go about this would be having support for “content extensions” in WebKit (see bug #167941, it is already possible today by using WebKitWebPage::send-request in a Web Extension.

Provide a way for Cog to request handling of key bindings

Currently, the FDO platform plug-in hardcodes a set of key bindings (e.g. Alt+Left and Alt+Right to navigate back and forth, see #20 for example), but the correct thing to do would be to provide API in libcogcore to install a set of key bindings in a generic way.

encoding problem

I install cog and wpebackend-rdk on raspberrypi 3 using buildroot. Everything works fine, but
I don't know how to set up encoding correctly. Czech characters are not displayed properly (ě ř dispay as squares and other ščžýáíé is displayed correctly.) i try set system locales to en_US.UTF-8 and cz_CZ.UTF-8, load local html files in utf-8 and ascii encoding and problem still persist.
Don't you know what I'm doing wrong?

Thanks for help.

Ensure that code formatting and style is consistent

Code style more or less follows that of GLib. It would be good to make sure that all the files are formatted accordingly. For example platform/cog-platform-fdo.c has many instances of missing spaces between function names and the opening parenthesis for the argument list.

Youtube - "Your browser does not currently recognize any of the video formats available"

Hi, I'm trying to open Youtube links e.g. cog -P fdo https://www.youtube.com/watch?v=-6_0XRRHAFU but am getting this error on the Youtube page:

Your browser does not currently recognize any of the video formats available

I'm using WPE Webkit compiled from the 2.24.2 tarball, with these enabled features:

-- Enabled features:
--  ENABLE_ACCELERATED_2D_CANVAS ........... OFF
--  ENABLE_ENCRYPTED_MEDIA                   OFF
--  ENABLE_GTKDOC .......................... OFF
--  ENABLE_MEDIA_SOURCE                      ON
--  ENABLE_VIDEO ........................... ON
--  ENABLE_WEBDRIVER                         ON
--  ENABLE_WEB_AUDIO ....................... ON
--  ENABLE_WEB_CRYPTO                        ON
--  ENABLE_WPE_QT_API ...................... OFF
--  ENABLE_XSLT                              ON
--  USE_OPENJPEG ........................... ON
--  USE_WOFF2                                ON

Is there some other setting required to make Youtube playback work?

Doesn't load error page upon WebProcess crash

By default an error page should be loaded when the WebProcess crashes, but currently crashing page remains on screen, seems like the UI process keeps the last frame before the crash happened.

fdo: Using Alt+Left or Alt+Right to go back/forward results in error

Using Alt+Left:

** (cog:10901): CRITICAL **: 15:21:39.085: void webkit_web_view_go_back(WebKitWebView*): assertion 'WEBKIT_IS_WEB_VIEW(webView)' failed

Conversely, with Alt+Right:

** (cog:10901): CRITICAL **: 15:21:39.745: void webkit_web_view_go_forward(WebKitWebView*): assertion 'WEBKIT_IS_WEB_VIEW(webView)' failed

Using a platform plug-in should not need libWPEBackend-default.so

Currently, even if a platform plug-in is loaded (e.g. passing --platform=fdo in the command line), it is still needed to have around a libWPEBackend-default.so shared object, which typically is a symlink to the actual WPE backend being used.

Ideally, when using a Cog platform plug-in, libWPEBackend-default.so should not be needed at all — though of course it could be still be used when running without any platform plug-in.

Fine-grained control of allowed site permissions

With #84 Cog gained initial support for granting site permission requests; it added the following command line option:

  • --set-permissions=all — grants any permission that any website requests.
  • --set-permissions=none — denies all permissions for any website.

It would be desirable to allow specifying which permissions are to be automatically granted and for which domains. The idea is to reuse --set-permissions= passing it a value different than all or none:

  • The value is semicolon-separated list of specifiers: --set-permissions=spec[;spec[;…]].
  • Each specifier would be a domain:permission[,permission[,…]] element.

where domain can be:

  • An exact domain name (example: gist.github.com).
  • A wildcard (example: *) meaning “any domain”.
  • A wildcard followed by a domain name (example: *github.com) meaning “the github.com domain or any of its subdomains”.
  • A wildcard followed by a period and a domain name (example: *.github.com) meaning “any subdomain of github.com but not github.com itself”.

and permission can be:

Transparent background

Is transparent background supported with the Cog Launcher?
I'm trying to run application on the imx6 where gstreamer is sending video to the /dev/fb0 and I need to have a transparent UI that would be drawn on the /dev/fb1.

File descriptor leak

We are experimenting with using cog using the wpe-fdo backend, and we are experiencing a file descriptor leak:

listing the file descriptors at about 1 / second

# ls -l /proc/709/fd | wc -l
625
# ls -l /proc/709/fd | wc -l
627
# ls -l /proc/709/fd | wc -l
631
# ls -l /proc/709/fd | wc -l
631
# ls -l /proc/709/fd | wc -l
635
# ls -l /proc/709/fd | wc -l
635
# ls -l /proc/709/fd | wc -l
639

listing of the file descriptors:

lrwx------    1 root     root            64 Apr 10 21:30 81 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:33 810 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:33 811 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:33 812 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:33 813 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:33 814 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:33 815 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:33 816 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:33 817 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:33 818 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:33 819 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:30 82 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:33 820 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:33 821 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:33 822 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:33 823 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:33 824 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:33 825 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:33 826 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:33 827 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:33 828 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:33 829 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:30 83 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:33 830 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:33 831 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:33 832 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:33 833 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:33 834 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:33 835 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:33 836 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:33 837 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:33 838 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:30 84 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:30 85 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:30 86 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:30 87 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:30 88 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:30 89 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:29 9 -> anon_inode:[eventfd]
lrwx------    1 root     root            64 Apr 10 21:30 90 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:30 91 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:30 92 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:30 93 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:30 94 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:30 95 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:30 96 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:30 97 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:30 98 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr 10 21:30 99 -> anon_inode:dmabuf

Is there anything we might be doing wrong? Maybe an incorrect configuration?

Last master fails to work with non-fdo

Not sure if this was caused by 17cfde0 or it was a previous issue.

I'm testing with ae3e565 and wpebackend-rdk/wayland-egl and cog is currently broken unless a "-P randomstring is passed".

Simply starting cog without parameters fails with:

root@qemux86-64:~# cog http://igalia.com
(cog:2550): Cog-DEBUG: platform_setup: Platform name: (null)
(cog:2550): Cog-DEBUG: platform_setup: Platform = (nil)

(cog:2550): Cog-CRITICAL **: cog_platform_get_view_backend: assertion 'platform != NULL' failed
**
Cog:ERROR:/usr/src/debug/cog/20180514-r0/git/cog.c:301:on_create_web_view: 'error' should not be NULL
Aborted

Starting it with a random invalid platform plugin name however works

root@qemux86-64:~# cog -P nonexistent http://igalia.com
(cog:2557): Cog-DEBUG: platform_setup: Platform name: nonexistent
(cog:2557): Cog-DEBUG: platform_setup: Platform plugin: libcogplatform-nonexistent.so

(cog:2557): Cog-WARNING **: Could not load: libcogplatform-nonexistent.so (possible cause: Socket operation on non-socket).

(cog:2557): Cog-DEBUG: Instantiating default WPE backend as fall-back.
xkbcommon: ERROR: couldn't find a Compose file for locale "C"
Cog-Message: <http://igalia.com/> Load started.
Cog-Message: <http://www.igalia.com/> Redirected.
Cog-Message: <https://www.igalia.com/> Redirected.
Cog-Message: <https://www.igalia.com/> Loading...
Cog-Message: <https://www.igalia.com/> Loaded successfully.

Provide a “default” platform plug-in

Now that #60 is merged, and we are using libwpe's support to set the name of the library that contains the backend implementation, it would be good to move the fall-back code that instantiates the default WPE backend as fall-back (in cog.c, function on_create_view) into its own platform plug-in, which sets the implementation library to libWPEBackend-default.so.

Support launching in WebDriver automation mode

Support for WebDriver is present in WPE WebKit, but currently cannot be used. Cog needs to support being launched in “automation mode”, e.g. with an --automation command line flag.

fd leaks in cog

Hi All,
I have a linux based system with 7 inch touch screen display .
For UI, I am using cog 0.3.0 + WPEWebkit 2.24 + wpebackend-fdo 1.2.0 + wayland.
I see that every touch event generates new fd in "/proc/ < cogpid > /fd" .
The problem is that these fd never get recycled. They keep on increasing unless it reaches 1024 at which point the cog application crashes.

cat /proc/ < cog pid > /limits show that the allowed number of Max open files is 1024. So cog crashes when the limit of 1024 file descriptors is breached .

Here is a look at the fd list :

root@imx8m-kopera-polar0:/# ls -l /proc/1170/fd | less
dr-x------    2 root     root             0 Apr  4 03:52 .
dr-xr-xr-x    8 root     root             0 Apr  4 03:52 ..
lr-x------    1 root     root            64 Apr  4 03:52 0 -> /dev/null
lrwx------    1 root     root            64 Apr  4 03:52 1 -> socket:[6498]
lrwx------    1 root     root            64 Apr  4 03:52 10 -> socket:[8223]
lrwx------    1 root     root            64 Apr  4 03:52 100 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr  4 03:52 101 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr  4 03:52 102 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr  4 03:52 103 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr  4 03:52 104 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr  4 03:52 105 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr  4 03:52 106 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr  4 03:52 107 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr  4 03:52 108 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr  4 03:52 109 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr  4 03:52 11 -> anon_inode:[eventfd]
lrwx------    1 root     root            64 Apr  4 03:52 110 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr  4 03:52 111 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr  4 03:52 112 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr  4 03:52 113 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr  4 03:52 114 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr  4 03:52 115 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr  4 03:52 116 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr  4 03:52 117 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr  4 03:52 118 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr  4 03:52 119 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr  4 03:52 12 -> socket:[3831]
lrwx------    1 root     root            64 Apr  4 03:52 120 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr  4 03:52 121 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr  4 03:52 122 -> anon_inode:dmabuf
lrwx------    1 root     root            64 Apr  4 03:52 123 -> anon_inode:dmabuf

the list goes on ....

When the system crashes I see the following print from cog :

Cog:ERROR:/mnt/workspace/beta/3/polar-yocto/build/default/tmp/work/aarch64-kopera-linux/cog/gitAUTOINC-r0/git/platform/cog-platform-fdo.c:1060:on_export_egl_image: 'wpe_view_data.buffer' should not be NULL
Aborted

I also found that the same bug has been reported in wayland
https://bugs.freedesktop.org/show_bug.cgi?id=100298
But, they marked it as "RESOLVED NOTOURBUG".

CogLauncher should probably not be a GApplication

Right now, CogLauncher inherits from GApplication, which is convenient for Cog because it moves all the useful logic into libcogcore, simplifying the actual program and make it play well on Freedesktop.org systems.

However, in platforms where the features brought in by GApplication are not needed, this inheritance becomes a problem, making libcogcore less flexible to systems outside Freedesktop.org.

The solution would be making CogLauncher not inherit from GApplication, and implement the GApplication logic in cog.c instead.

Build fails when configuring with CMake to use Makefiles

Steps to reproduce:

% cmake -G 'Unix Makefiles' . && make
...
[ 52%] Generating WaylandProtocols.dir/fullscreen-shell-unstable-v1-client.h
Could not open output file: No such file or directory
make[2]: *** [CMakeFiles/cogplatform-fdo.dir/build.make:74: WaylandProtocols.dir/fullscreen-shell-unstable-v1-client.h] Error 1
make[1]: *** [CMakeFiles/Makefile2:109: CMakeFiles/cogplatform-fdo.dir/all] Error 2

(Issue reported by @bertogg — thanks!)

Loading a video file directly fails

When trying to use cog to load a raw video file fails.
Example

$ cog https://people.igalia.com/clopez/wkbug/video/big_buck_bunny.mp4
Cog-Message: <https://people.igalia.com/clopez/wkbug/video/big_buck_bunny.mp4> Load started.
Cog-Message: <https://people.igalia.com/clopez/wkbug/video/big_buck_bunny.mp4> Loading...

(cog:31588): Cog-WARNING **: <https://people.igalia.com/clopez/wkbug/video/big_buck_bunny.mp4> Page load error: Plug-in handled load
Cog-Message: <https://people.igalia.com/clopez/wkbug/video/big_buck_bunny.mp4> Loaded successfully.
Cog-Message: <https://people.igalia.com/clopez/wkbug/video/big_buck_bunny.mp4> Load started.
Cog-Message: <https://people.igalia.com/clopez/wkbug/video/big_buck_bunny.mp4> Loading...
Cog-Message: <https://people.igalia.com/clopez/wkbug/video/big_buck_bunny.mp4> Loaded successfully.

On the screen you first see the video for a brief moment (~1 second) and then an error page appears (Page load error: Plug-in handled load).

Needless to say that loading this (a video file directly) with other WebKit based launchers/browsers works fine.

Support configuring how and when to store cookies

By default WebKit already keeps cookies in transient storage around (otherwise many websites would not work), but it would be good to allow enabling persistent storage of the cookies. In general, it would be great to expose the functionality of WebKitCookieManager:

  • Enabling persistent storage.
  • Setting the cookies storage format (plain text, SQLite).
  • Configuring the path to the cookie jar (optional, automatically derive a path into $XDG_CONFIG_HOME).
  • Pre-filling cookies.

Can COG detect when a page did not load and retry?

I would like to startup a webpage using COG, if the page doesn't load or stops loading due to;

  1. Networking issues
  2. Time Server not updated correctly

Is there a flag, to retry or refresh? If not, I can test prior but it would be nice.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.