DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Coding
  3. Frameworks
  4. Unpacking and Editing a Chrome Extension

Unpacking and Editing a Chrome Extension

Lorna Mitchell user avatar by
Lorna Mitchell
·
Dec. 19, 12 · Interview
Like (0)
Save
Tweet
Share
4.22K Views

Join the DZone community and get the full member experience.

Join For Free

i've been having an issue with one of my chrome extensions recently - the keyboard navigation extension that i blogged about previously . this is a huge problem for me because without this extension, i can't "click" on anything on the internet! it was working on some pages, but on others it was drawing elements but not styling them correctly. the extension doesn't seem to be actively maintained, so i realised i was going to have to dive into the extension itself to understand the problems and have any chance of fixing it. hurrah for open source software (not that i really write any js but i figured if i could understand the problem, maybe i could ask more intelligent questions)

unpacking a chrome extension

actually this didn't take much unpacking once i found it. for me on ubuntu, all my files were in ~/.config/google-chrome/default/extensions/ . the key is to visit chrome://extensions , and turn on "developer mode" which is a tickbox in the top right corner. then copy the id of the extension you're going to be working with.

in the extensions directory, there are directories named in a garbledy way, but the directory names match the ids of the extensions you see in chrome, so copy whichever extension you need to another location. you can then click the "load unpacked extension" button to use your version of the extension instead of the existing one (i didn't uninstall the previous version and it didn't seem to cause a problem).

(i did find that i needed to add "version": 2 to the manifest file, but i think that was just because this is an older extension. if you need to do this, chrome gives you a very clear error and link to more info when you try to load the extension)

at this point, you can edit to your heart's content, and then when you're ready to try out your changes in chrome, save the files and click on the reload link for your extension.

fixing the keyboard navigation extension

i'm not sure exactly what was causing the problem with the keyboard navigation extension, i observed all the little labels being created at the end of the page, but not styled or moved correctly ... critically the stylesheet includes a "position: absolute" which is how you know which label is for which page element! to fix the problem, i applied all the style properties programmatically in the code, bit of a hacky solution but it works for me.

i may also have taken the opportunity to de-orange the little labels too!

if you'd like the hacked version of the extension, you can find it on bitbucket: https://bitbucket.org/lornajane/keyboard-navigation-for-chrome/overview

Open source Open-source software Label Directory Links Element ubuntu Manifest (transportation)

Published at DZone with permission of Lorna Mitchell, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Public Cloud-to-Cloud Repatriation Trend
  • Spring Boot Docker Best Practices
  • Fraud Detection With Apache Kafka, KSQL, and Apache Flink
  • Beginners’ Guide to Run a Linux Server Securely

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: