[Pkg-mozext-commits] [autofill-forms] 06/13: fixing bug number #5

David Prévot taffit at moszumanska.debian.org
Thu Oct 29 20:57:37 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository autofill-forms.

commit ef29359953109735ebbf2f99fd533c84af70dd6e
Author: Sarah Avilov <sarah.avilov at gmail.com>
Date:   Mon Aug 17 12:01:07 2015 +0430

    fixing bug number #5
---
 aff.xpi                               | Bin 152586 -> 152708 bytes
 chrome/content/inject.js              |  34 ++++++++++++++++++++--------------
 defaults/preferences/autofillForms.js |   2 +-
 3 files changed, 21 insertions(+), 15 deletions(-)

diff --git a/aff.xpi b/aff.xpi
index 4400c91..1fbd8f4 100644
Binary files a/aff.xpi and b/aff.xpi differ
diff --git a/chrome/content/inject.js b/chrome/content/inject.js
index 7094137..3116d93 100644
--- a/chrome/content/inject.js
+++ b/chrome/content/inject.js
@@ -10,53 +10,59 @@ function onchange (elem) {
   catch (e) {}
 }
 
+function toList (att) {
+  return [].concat.apply(
+    [content.document],
+    [].map.call(content.document.getElementsByTagName('iframe'), f => f.contentDocument)
+  )
+  .map(function (doc) {
+    return [].slice.call(doc.querySelectorAll(att), 0);
+  })
+  .reduce(function (a, b) {
+    return [].concat.call(a, b);
+  });
+}
+
 addMessageListener('click', function () {
-  var elems = content.document.querySelectorAll('[data-aff-click=true]');
-  [].forEach.call(elems, function (elem) {
+  toList('[data-aff-click=true]').forEach(function (elem) {
     elem.removeAttribute('data-aff-click');
     elem.click();
   });
 });
 addMessageListener('submit', function () {
-  var elems = content.document.querySelectorAll('[data-aff-submit=true]');
-  [].forEach.call(elems, function (elem) {
+  toList('[data-aff-submit=true]').forEach(function (elem) {
     elem.removeAttribute('data-aff-submit');
     elem.submit();
   });
 });
 addMessageListener('focus', function () {
-  var elems = content.document.querySelectorAll('[data-aff-focus=true]');
-  [].forEach.call(elems, function (elem) {
+  toList('[data-aff-focus=true]').forEach(function (elem) {
     elem.removeAttribute('data-aff-focus');
     elem.focus();
     onchange(elem);
   });
 });
 addMessageListener('change', function () {
-  var elems = content.document.querySelectorAll('[data-aff-change=true]');
-  [].forEach.call(elems, function (elem) {
+  toList('[data-aff-change=true]').forEach(function (elem) {
     elem.removeAttribute('data-aff-change');
     onchange(elem);
   });
 });
 addMessageListener('value', function () {
-  var elems = content.document.querySelectorAll('[data-aff-value]');
-  [].forEach.call(elems, function (elem) {
+  toList('[data-aff-value]').forEach(function (elem) {
     elem.value = elem.dataset.affValue;
     elem.removeAttribute('data-aff-value');
     onchange(elem);
   });
 });
 addMessageListener('selectionEnd', function () {
-  var elems = content.document.querySelectorAll('[data-aff-selectionEnd]');
-  [].forEach.call(elems, function (elem) {
+  toList('[data-aff-selectionEnd]').forEach(function (elem) {
     elem.selectionEnd = elem.dataset.affSelectionEnd;
     elem.removeAttribute('data-aff-selectionEnd');
   });
 });
 addMessageListener('selectionStart', function () {
-  var elems = content.document.querySelectorAll('[data-aff-selectionStart]');
-  [].forEach.call(elems, function (elem) {
+  toList('[data-aff-selectionStart]').forEach(function (elem) {
     elem.selectionStart = elem.dataset.affSelectionStart;
     elem.removeAttribute('data-aff-selectionStart');
   });
diff --git a/defaults/preferences/autofillForms.js b/defaults/preferences/autofillForms.js
index a6dbf2e..1cca000 100644
--- a/defaults/preferences/autofillForms.js
+++ b/defaults/preferences/autofillForms.js
@@ -18,7 +18,7 @@ pref('extensions.autofillForms at blueimp.net.profileLabels', 'chrome://autofillFor
 pref('extensions.autofillForms at blueimp.net.dynamicTags', 'chrome://autofillForms/locale/autofillForms.properties');
 pref('extensions.autofillForms at blueimp.net.dynamicTagCodes', 'chrome://autofillForms/locale/autofillForms.properties');
 pref('extensions.autofillForms at blueimp.net.regExpPasswordLabel', 'chrome://autofillForms/locale/autofillForms.properties');
-pref('extensions.autofillForms at blueimp.net.regExpFormFieldTypes', '^(?:(?:text(?:area)?)|(?:select-(?:(?:one)|(?:multiple)))|(?:checkbox)|(?:radio)|(?:email)|(?:url)|(?:password)|(?:file))$');
+pref('extensions.autofillForms at blueimp.net.regExpFormFieldTypes', '^(?:(?:text(?:area)?)|(?:select-(?:(?:one)|(?:multiple)))|(?:checkbox)|(?:radio)|(?:email)|(?:url)|(?:number)|(?:password)|(?:file))$');
 pref('extensions.autofillForms at blueimp.net.enableDynamicTags', false);
 pref('extensions.autofillForms at blueimp.net.profileIndex', 0);
 pref('extensions.autofillForms at blueimp.net.storeEncrypted', false);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/autofill-forms.git



More information about the Pkg-mozext-commits mailing list