mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 17:24:23 +00:00
Add user option to disable JavaScript in xwidget webview
* src/xwidget.c: Add the 'xwidget-webkit-disable-javascript' variable to disable JavaScript in WebKit sessions. (Bug#68604) * etc/NEWS: * doc/emacs/misc.texi (Embedded Webkit Widgets): Document the change.
This commit is contained in:
parent
013114664e
commit
f6a27bc32d
4 changed files with 28 additions and 1 deletions
|
|
@ -3009,6 +3009,14 @@ buffer, and lets you navigate to those pages by hitting @kbd{RET}.
|
|||
|
||||
It is bound to @kbd{H}.
|
||||
|
||||
@vindex xwidget-webkit-disable-javascript
|
||||
@cindex disabling javascript in webkit buffers
|
||||
JavaScript is enabled by default inside WebKit buffers, this can be
|
||||
undesirable as websites often use it to track your online activity. It
|
||||
can be disabled by setting the variable @code{xwidget-webkit-disable-javascript} to @code{t}.
|
||||
You must kill all WebKit buffers for this setting to take effect after
|
||||
it is changed.
|
||||
|
||||
@node Browse-URL
|
||||
@subsection Following URLs
|
||||
@cindex World Wide Web
|
||||
|
|
|
|||
6
etc/NEWS
6
etc/NEWS
|
|
@ -1437,6 +1437,12 @@ This allows the user to customize the key selection method, which can be
|
|||
either by using a pop-up buffer or from the minibuffer. The pop-up
|
||||
buffer method is the default, which preserves previous behavior.
|
||||
|
||||
** Xwidget Webkit
|
||||
|
||||
+++
|
||||
*** New user option 'xwidget-webkit-disable-javascript'.
|
||||
This allows disabling JavaScript in xwidget Webkit sessions.
|
||||
|
||||
|
||||
* New Modes and Packages in Emacs 30.1
|
||||
|
||||
|
|
|
|||
|
|
@ -116,6 +116,13 @@ buffers for this setting to take effect after setting it to nil."
|
|||
:type '(choice (const :tag "Do not store cookies" nil) file)
|
||||
:version "29.1")
|
||||
|
||||
(defcustom xwidget-webkit-disable-javascript nil
|
||||
"If non-nil, disables the execution of JavaScript in xwidget webkit sessions.
|
||||
You must kill all xwidget-webkit buffers for this setting to take
|
||||
effect after changing it."
|
||||
:type '(boolean)
|
||||
:version "30.0")
|
||||
|
||||
;;;###autoload
|
||||
(defun xwidget-webkit-browse-url (url &optional new-session)
|
||||
"Ask xwidget-webkit to browse URL.
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
|
|||
#include "buffer.h"
|
||||
#include "coding.h"
|
||||
#include "xwidget.h"
|
||||
|
||||
#include "lisp.h"
|
||||
#include "blockinput.h"
|
||||
#include "dispextern.h"
|
||||
|
|
@ -379,6 +378,7 @@ fails. */)
|
|||
/* Enable the developer extras. */
|
||||
settings = webkit_web_view_get_settings (WEBKIT_WEB_VIEW (xw->widget_osr));
|
||||
g_object_set (G_OBJECT (settings), "enable-developer-extras", TRUE, NULL);
|
||||
g_object_set (G_OBJECT (settings), "enable-javascript", !xwidget_webkit_disable_javascript, NULL);
|
||||
}
|
||||
|
||||
gtk_widget_set_size_request (GTK_WIDGET (xw->widget_osr), xw->width,
|
||||
|
|
@ -3972,6 +3972,12 @@ syms_of_xwidget (void)
|
|||
doc: /* List of all xwidget views. */);
|
||||
Vxwidget_view_list = Qnil;
|
||||
|
||||
DEFVAR_BOOL("xwidget-webkit-disable-javascript", xwidget_webkit_disable_javascript,
|
||||
doc: /* If non-nil, disables the execution of JavaScript in xwidget webkit sessions.
|
||||
You must kill all xwidget-webkit buffers for this setting to take
|
||||
effect after changing it. */);
|
||||
xwidget_webkit_disable_javascript = false;
|
||||
|
||||
Fprovide (intern ("xwidget-internal"), Qnil);
|
||||
|
||||
id_to_xwidget_map = CALLN (Fmake_hash_table, QCtest, Qeq,
|
||||
|
|
|
|||
Loading…
Reference in a new issue