emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Introducing emacs-webkit and more thoughts on Emacs rendering (was R


From: Akira Kyle
Subject: Re: Introducing emacs-webkit and more thoughts on Emacs rendering (was Rethinking the design of xwidgets)
Date: Sun, 22 Nov 2020 11:33:48 -0700
User-agent: mu4e 1.4.13; emacs 28.0.50


On Sun, Nov 22, 2020 at 05:50 AM, Jean Louis <bugs@gnu.support> wrote:

There are 2 types of questions for you, one group of questions if for
dynamic module emacs-webkit:

- is it possible to make sure from start of the session not to use
  Javascript?

Yes,

(add-hook 'webkit-new-hook #'webkit-enable-javascript)

This should disable javascript on all sites. `webkit-enable-javascript` can be called interactively to disable javascript or enable if given a prefix arg. Although I just realized theres a bug here and the page load request will happen before the hook is applied. I'll fix this soon.

There's a thread on my post on reddit.com/r/emacs [1] where I talk a bit more about the process of disabling JS. To quote my comment there:

I should note that this sets the webkit `enable-javascript-markup` setting, not the 'enable-javascript' setting. I'm still figuring out how all these options are applied within webkit, but it seems like `enable-javascript-markup` disables a page from executing javascript by stripping it all out. `enable-javascript` would break the module since basic things like scrolling are handled by executing javascript in the view, which is allowed even if the page javascript is disabled with `enable-javascript-markup`. It seems like this is what email clients that use webkitgtk2 use since using javascript is really the only way to control the WebView given the WebKitDOM API is depricated. One could write the equavalent to window.scrollTo in C using the JavasScriptCore API but AFAIK that would be pretty much equivalent to what's currently happening.

- is it maybe possible at compile time to add an option
  --disable-javascript ?

I'm not sure if webkit has such an option to disable javascript and compile time. I think the JavaScriptCore must be present in order for webkit to even work.

- is there way during the session to surely disable javascript?

See above.

- it would be very nice if webkit dynamic module could bookmark
hyperlink in such a way that it can be programmatically captured by using Emacs Lisp. For example by pressing B that users can capture both the TITLE and URL together and store it how they wish. You could provide standard function and one customizable function. That way users could store the TITLE and URL without reloading the page
  into database, or into Org file, or other system.

Currently C-l copies the url (open to suggestions on improvements to the default keybindings as I don't use them myself). And the title and url can be retrieved from the module with `webkit--get-uri` and `webkit--get-title`. I don't personally use emacs builtin bookmarks but enough people seem interested in such a feature that it'll happen.

And some questions not related to the subject, rather to your skills
with dynamic modules:

Developers of emacs-libpq will soon contribute the dynamic module to GNU ELPA that offers bindings to PostgreSQL and that enhances Emacs greatly with possibilities. Related to that in GNU there is GDBM or
GNU database https://www.gnu.org/s/gdbm

I am just asking if you could think of programming the dynamic module that offers to users Emacs interface to GDBM. This type of database is much simpler and users most probably have it on their systems and it
can be used for business processes.

Reference to emacs-libpq @ Github
https://github.com/anse1/emacs-libpq

I'm not very knowledgeable about databases and don't directly interact them in my day-to-day so I don't have much of a personal motivation to work on such a problem thus I don't think I'm the right person for this project.

[1] https://www.reddit.com/r/emacs/comments/jyowe0/introducing_emacswebkit_a_successor_to/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]