Skip to content
This repository has been archived by the owner on Oct 2, 2022. It is now read-only.

Keyfixer removes text boxes in Firefox 34 #2

Closed
heisencoder opened this issue Dec 8, 2014 · 5 comments
Closed

Keyfixer removes text boxes in Firefox 34 #2

heisencoder opened this issue Dec 8, 2014 · 5 comments
Assignees

Comments

@heisencoder
Copy link
Owner

See https://bugzilla.mozilla.org/show_bug.cgi?id=1107703 for more background.

Screenshots showing issue:

As of this time, the root cause of the problem is not known.

@heisencoder heisencoder self-assigned this Dec 8, 2014
@tadgy
Copy link

tadgy commented Dec 10, 2014

Hey @heisencoder
I found and corrected the issue with Keyfixer for Firefox 34+.
Diff is attached. Consider it beerware :)

The issue was nothing to do with the key mappings - it was all down to a dodgy sed in the build.sh script. I've fixed the regexes that were used in there, and also made them work on BSD sed - Darwin users can now build this extension natively :)

Let me know if there's any problems.

Darren.

diff -ur keyfixer-master/README keyfixer-fixedfor34//README
--- keyfixer-master/README  2014-05-04 23:31:09.000000000 +0100
+++ keyfixer-fixedfor34//README 2014-12-10 12:50:36.705469528 +0000
@@ -2,7 +2,7 @@
 match those of Windows.

 Written by Matthew V. Ball <matt.ball@ieee.org> (http://mavaball.net)
-
+Contributions from Darren 'Tadgy' Austin <darren (at) afterdark.org.uk>
 Original keyfixer by Jim Mendenhall (http://www.starryhope.com)


diff -ur keyfixer-master/source/build.sh keyfixer-fixedfor34//source/build.sh
--- keyfixer-master/source/build.sh 2014-05-04 23:31:09.000000000 +0100
+++ keyfixer-fixedfor34//source/build.sh    2014-12-10 15:25:23.884208825 +0000
@@ -1,6 +1,7 @@
 #!/bin/bash
 # build.sh -- builds JAR and XPI files for mozilla extensions
 #   by Nickolay Ponomarev <asqueella@gmail.com>
+#   contibutions by Darren 'Tadgy' Austin <darren (at) afterdark.org.uk>
 #   (original version based on Nathan Yergler's build script)
 # Most recent version is at <http://kb.mozillazine.org/Bash_build_script>

@@ -44,10 +45,13 @@
   . $1
 fi

-if [ -z $APP_NAME ]; then
+if [ -z "$APP_NAME" ]; then
   echo "You need to create build config file first!"
   echo "Read comments at the beginning of this script for more info."
-  exit;
+  exit 1;
+elif [[ "$APP_NAME" =~ .*[[:upper:]]|\.|/|[[:space:]].* ]]; then
+  echo "App names must be all lowercase and can not contain . / or spaces."
+  exit 1
 fi

 ROOT_DIR=`pwd`
@@ -103,13 +107,17 @@
   # Then try this! (Same, but with characters escaped for bash :)
 # These work for GNU sed (Linux, Cygwin)
 # Note from Matt:  For the life of me, I can't get this to work on Mac OS X, using BSD SED.  I made this change by hand...
-  sed -i -r s/^\(content\\s+\\S*\\s+\)\(\\S*\\/\)$/\\1jar:chrome\\/$APP_NAME\\.jar!\\/\\2/ chrome.manifest
-  sed -i -r s/^\(skin\|locale\)\(\\s+\\S*\\s+\\S*\\s+\)\(.*\\/\)$/\\1\\2jar:chrome\\/$APP_NAME\\.jar!\\/\\3/ chrome.manifest
+#  sed -i -r s/^\(content\\s+\\S*\\s+\)\(\\S*\\/\)$/\\1jar:chrome\\/$APP_NAME\\.jar!\\/\\2/ chrome.manifest
+#  sed -i -r s/^\(skin\|locale\)\(\\s+\\S*\\s+\\S*\\s+\)\(.*\\/\)$/\\1\\2jar:chrome\\/$APP_NAME\\.jar!\\/\\3/ chrome.manifest
 # Note from Matt: This is the closest I got, but it doesn't work...
 #  sed -E -e "s/^(content\\s+\\S*\\s+)(\\S*\\/)$/\\1jar:chrome\\/$APP_NAME\\.jar!\\/\\2/g" chrome.manifest
 #  sed -E -e "s/^(skin\|locale)(\\s+\\S*\\s+\\S*\\s+)(.*\\/)$/\\1\\2jar:chrome\\/$APP_NAME\\.jar!\\/\\3/g" chrome.manifest
-
-  # (it simply adds jar:chrome/whatever.jar!/ at appropriate positions of chrome.manifest)
+# Note from Darren: This should work on GNU sed as well as BSD sed.
+  SED_ARGS="-r -i"
+  [[ "$(uname -s)" =~ (Darwin|.*BSD) ]] && SED_ARGS="-E -i ''"
+  sed $SED_ARGS "s/^([[:space:]]*content[[:space:]]+)[^[:space:]]+([[:space:]]+jar:chrome\/)[^\.]+(\.jar.*)/\1${APP_NAME}\2${APP_NAME}\3/" chrome.manifest
+  sed $SED_ARGS "s/^([[:space:]]*override[[:space:]]+[^[:space:]]+[[:space:]]+chrome:\/\/)[^\/]+(\/.*)/\1${APP_NAME}\2/g" chrome.manifest
+  # I didn't re-write the (skin|locale) regex as it wasn't used in the chrome.manifest file.  Should be easy enough to figure it out though :)
 fi

 # generate the XPI file
@@ -127,7 +135,7 @@
 fi

 # remove the working files
-rm -rf $TMP_DIR
+#rm -rf $TMP_DIR
 echo "Done!"

 $AFTER_BUILD
diff -ur keyfixer-master/source/install.rdf keyfixer-fixedfor34//source/install.rdf
--- keyfixer-master/source/install.rdf  2014-05-04 23:31:09.000000000 +0100
+++ keyfixer-fixedfor34//source/install.rdf 2014-12-10 12:52:22.003640346 +0000
@@ -4,9 +4,10 @@
   <Description about="urn:mozilla:install-manifest">
     <em:id>keyfixer@mavaball.net</em:id>
     <em:name>Keyfixer</em:name>
-    <em:version>0.5.29</em:version>
+    <em:version>0.5.30</em:version>
     <em:creator>Matthew V. Ball</em:creator>
     <em:contributor>Matthew V. Ball</em:contributor>
+    <em:contributor>Darren 'Tadgy' Austin</em:contributor>
     <em:description>Changes keyboard bindings for Mac OS X users to match Windows key bindings</em:description>
     <em:homepageURL>http://mavaball.net/wiki/index.php/Keyfixer</em:homepageURL>
     <em:iconURL>chrome://keyfixer/content/keyfixer.png</em:iconURL>

@heisencoder
Copy link
Owner Author

Hi tadgy,

I tried this patch verbatim, but am still having trouble with disappearing dialog boxes. Thanks for giving it a shot, though! I'll dig a bit more...

Cheers,
-Matt

@heisencoder
Copy link
Owner Author

I grabber a fresh baseline of platformHTMLBindings.xml from Firefox 34, and found this diff against Firefox 29:

Ball-Family-Mac-Mini:content matt$ diff platformHTMLBindings.xml platformHTMLBindings_ref_29.xml
11c11

<

22c22

<

I'm betting that this could be affecting the inputFields and textAreas. I'll create a new version with this baseline.

@heisencoder
Copy link
Owner Author

I think I've got this fixed now, and have confirmed that it works locally. I'll need to push later, though. For those chomping at the bit, check out releases/keyfixer_0-5-34.xpi in the repository.

@heisencoder
Copy link
Owner Author

I've uploaded a new version of keyfixer to the Mozilla website, although it appears to need review at this point. Hopefully it will go out soon. Closing this bug.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants