From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Aaron Conole Newsgroups: gmane.emacs.devel Subject: [PATCH RFC 2/2] Expose the user-agent setting with a getter/setter Date: Mon, 6 Jun 2016 14:18:10 -0400 Message-ID: <1465237090-24315-3-git-send-email-aconole@bytheb.org> References: <1465237090-24315-1-git-send-email-aconole@bytheb.org> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1465237125 17877 80.91.229.3 (6 Jun 2016 18:18:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 6 Jun 2016 18:18:45 +0000 (UTC) To: emacs-devel , joakim@verona.se Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 06 20:18:39 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1b9z6h-0002ut-VK for ged-emacs-devel@m.gmane.org; Mon, 06 Jun 2016 20:18:36 +0200 Original-Received: from localhost ([::1]:44439 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9z6h-0004DS-4o for ged-emacs-devel@m.gmane.org; Mon, 06 Jun 2016 14:18:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47425) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9z6W-0004CE-C7 for emacs-devel@gnu.org; Mon, 06 Jun 2016 14:18:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b9z6P-0002Da-QW for emacs-devel@gnu.org; Mon, 06 Jun 2016 14:18:23 -0400 Original-Received: from mail-qk0-x241.google.com ([2607:f8b0:400d:c09::241]:34901) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9z6P-0002DK-ND for emacs-devel@gnu.org; Mon, 06 Jun 2016 14:18:17 -0400 Original-Received: by mail-qk0-x241.google.com with SMTP id l185so9173558qkc.2 for ; Mon, 06 Jun 2016 11:18:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytheb-org.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=KfrKBSJ22d7cE75oXknZv/sN5jd1Wabpr8E2obLpxro=; b=B+cS35+2lB3XAxDVzvfptXQ1BUswtWs8P7VJWD5gmERkKHADkQiCdxx6EL2h/xoajc cbQt5glsJvqof9D0JBqU+nT8gHYCrMou5O/YZN19c+om75ZUX2fX2ZlSo2eykNIMRc/7 rh5oNN0u5idvn3EU2JjVyBhwj0SXzixhuj2WBIchvOsQwPaVjxyWwrMigzuzwq0ILEL7 CtLm6wiEUhqNNa6uIEvIJE9gSNQU0071kD8W+4He0zUibKPdL6tMdzpgcDrlcO4RByGB jDxctEA7RpGvuw9fi+vWRMDes49euN5tThUBKiTJBM1JR7QMGR/aIzixG21Nl3BXF5un Zb9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=KfrKBSJ22d7cE75oXknZv/sN5jd1Wabpr8E2obLpxro=; b=GSQDra77Q5M2tPzDlghp0Wl1Zg5jwjdFZepQ6ecKEj0sCNAAYzhKX24PdFnugYTEEF 0dOY9D9GJI+8cqGqq4FifTlBpsLzQZYMn1a5qnsBXe3ZzzlpHzD9/ymPbcpHIDsNlibP jjUwtqZ6IeqKF7xBVn76o7WZsjfi9pnFJL1zmbX3WRACP3DTxz0pC0eNSBraZScAYcX9 DGj01zq4uraQfY0TlpOMncHJwV7qDZ5b0GZKFLsWOkK5FiUoZfhE0S8x30ODgTc2P9eH VscgMTmM2oU4CfVGKh/x3iZjcPNF0CwphgDvfGP3IigyuX68RehYYGdsT334uieVK5aC GWig== X-Gm-Message-State: ALyK8tKznCHOv0DPfBKYSUqOx5VMw1tTCk9Y0rN4tcaSlqMqHjPzd8pyjvkozMZ5Rdr4RQ== X-Received: by 10.55.129.65 with SMTP id c62mr16650344qkd.171.1465237097376; Mon, 06 Jun 2016 11:18:17 -0700 (PDT) Original-Received: from aconole-fed23.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id g10sm5464396qgg.13.2016.06.06.11.18.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jun 2016 11:18:16 -0700 (PDT) X-Mailer: git-send-email 2.5.5 In-Reply-To: <1465237090-24315-1-git-send-email-aconole@bytheb.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400d:c09::241 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:204211 Archived-At: * lisp/xwidget.el (xwidget-webkit-get-user-agent): New function to get the user agent for the current webkit session (xwidget-webkit-set-user-agent): New function to set the user agent for the current webkit session --- lisp/xwidget.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lisp/xwidget.el b/lisp/xwidget.el index 7a0ca8b..64fe899 100644 --- a/lisp/xwidget.el +++ b/lisp/xwidget.el @@ -462,6 +462,18 @@ xwidget-webkit-current-url (message "url: %s" url) url)) +(defun xwidget-webkit-get-user-agent () + "Get the webkit UserAgent string." + (interactive) + (xwidget-webkit-get-web-string-setting (xwidget-webkit-current-session) + "user-agent")) + +(defun xwidget-webkit-set-user-agent (ua) + "Set the webkit UserAgent string." + (interactive) + (xwidget-webkit-set-web-string-setting (xwidget-webkit-current-session) + "user-agent" ua)) + (defun xwidget-webkit-execute-script-rv (xw script &optional default) "Same as `xwidget-webkit-execute-script' but with return value. XW is the webkit instance. SCRIPT is the script to execute. -- 2.5.5