Welcome guest, is this your first visit? Create Account now to join.
Results 1 to 4 of 4

This is a discussion on Looking to create an Extension for Chrome within the Plugins Development section, part of the Chrome Plugins category: Hi, I am thinking to create an extension for Chrome browser. I am pretty new to it. I am wondering ...


  1. #1
    dpsubi1 is offline Junior Member
    Join Date
    May 2010
    Posts
    3

    Arrow Looking to create an Extension for Chrome

    Hi,

    I am thinking to create an extension for Chrome browser. I am pretty new to it. I am wondering whether I can do the following :

    I use 3rd party website which i cannot modify it as i do not have the code.

    a. I have a text box and form elements in that web page. I would like to do some regex replacements in the text box before users submits that form. my idea is creating a new javascript on that page to do regex replacements. i need to modify the form's onsubmit attribute. so that hitting enter on text box will call my javascript instead of existing web page's javascript. my javascript will call the existing web page's javascript after regex replace. just my idea. your inputs are welcome.

    b. If the above task is not possible by writing an extension what is your suggestions/alternatives to accomplish my requirement.

    c. Let's say I am creating a new text box in a web page using chrome extension. How to set accesskey to that text box. so that the user can simply press the access key to goto the text box. setting accesskey like
    input_dom.accesskey = "k";
    doesn't helped. the access key is not working by this way.

    would like to know whether it is possible to do and the way to do it.

    Thanks
    Last edited by dpsubi1; 05-27-2010 at 09:36 AM.

  2. #2
    Waha's Avatar
    Waha is offline Senior Member
    Join Date
    Apr 2009
    Location
    Oregon
    Posts
    788

    Default

    Yes, you can add an onsubmit.

    That would be because there is no native "accesskey" thing. You can set an onkeydown (or onkeyup, is the norm) event on the page, and focus the textbox when the event.key is 'k'
    Though I think the input boxes would inherit that event too, so you should make sure that nothing's focussed already before focusing the new text box.
    ~ Projects ~
    Specialized: Carapass Auction Watcher, Kongregate Chat
    Libraries: bliplib
    Tools: manifest syntax highlighting & snippits
    ~ Happy to make extensions for pay too ;D ~
    Portfolio: Search and Share

  3. #3
    dpsubi1 is offline Junior Member
    Join Date
    May 2010
    Posts
    3

    Default

    I want to modify the existing onsubmit attrib value, which is not working for me.

    reg. access key how to use onkeydown event ? can you show me an example. thanks

  4. #4
    Waha's Avatar
    Waha is offline Senior Member
    Join Date
    Apr 2009
    Location
    Oregon
    Posts
    788

    Default

    If the onsubmit is inline, you can access it like any other property.
    If it was applied as an event listener, you can't modify it.

    Use keydown/keyup like any other event, just apply it to the document body.
    http://www.w3schools.com/js/js_events.asp
    http://www.quirksmode.org/js/introevents.html
    ~ Projects ~
    Specialized: Carapass Auction Watcher, Kongregate Chat
    Libraries: bliplib
    Tools: manifest syntax highlighting & snippits
    ~ Happy to make extensions for pay too ;D ~
    Portfolio: Search and Share

Similar Threads

  1. How to create a new theme for Chrome 3.0.196.2 for newbies
    By sulasno in forum Themes Troubleshooting
    Replies: 5
    Last Post: 01-12-2011, 12:31 PM
  2. How to create a new theme for Stable / Beta / Dev Chrome
    By sulasno in forum Themes Development
    Replies: 24
    Last Post: 12-03-2009, 10:48 PM
  3. Create a tab and then delete it imediately
    By Tiby312 in forum Plugins Development
    Replies: 0
    Last Post: 11-26-2009, 09:53 PM
  4. chrome.tabs.create problem
    By Inco in forum Plugins Development
    Replies: 1
    Last Post: 11-09-2009, 07:52 AM
  5. Create & Read cookies problem
    By tuan_robert in forum Plugins Troubleshooting
    Replies: 0
    Last Post: 10-16-2009, 04:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •