Skip to content

Commit

Permalink
Select HMTL input elements without type (default type text) and their…
Browse files Browse the repository at this point in the history
… value attribute. Fixes #202.
  • Loading branch information
Woundorf committed Jun 24, 2019
1 parent b52d791 commit cb0104f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
* Fixed bug where certain fields were not replaced (#202).

v2.2.3 (2019-05-23)
* Fixed bug where the input type dropdown was badly positioned (#248).
* Shortcut to open the replace bar changed to Ctrl+Shift+F9 (#266).
Expand Down
4 changes: 3 additions & 1 deletion scripts/replace.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** ***** BEGIN LICENSE BLOCK *****
*
* Copyright (C) 2018 Marc Ruiz Altisent. All rights reserved.
* Copyright (C) 2019 Marc Ruiz Altisent. All rights reserved.
*
* This file is part of FoxReplace.
*
Expand Down Expand Up @@ -89,6 +89,7 @@ function replaceText(aDocument, aGroups, aPrefs) {

// Replace nodes with a "value" property
var valueNodesXpath = "/html/body//input[@type='text']"
+ "|/html/body//input[not(@type)]"
+ "|/html/body//textarea"
+ "|/html/body//@abbr"
+ "|/html/body//@alt"
Expand All @@ -97,6 +98,7 @@ function replaceText(aDocument, aGroups, aPrefs) {
+ "|/html/body//@summary"
+ "|/html/body//@title"
+ "|/html/body//input[@type!='hidden']/@value"
+ "|/html/body//input[not(@type)]/@value"
+ "|/html/body//option/@value"
+ "|/html/body//button/@value";
if (aPrefs.replaceUrls) {
Expand Down

0 comments on commit cb0104f

Please sign in to comment.