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

This is a discussion on Help with crazy simple options page within the Chrome Plugins section, part of the Google Chrome category: I've been looking around all over the web trying to get an options page working.. It's really driving me crazy. ...


  1. #1
    RubberBiscuit is offline Junior Member
    Join Date
    Jun 2010
    Posts
    2

    Post Help with crazy simple options page

    I've been looking around all over the web trying to get an options page working.. It's really driving me crazy. I finally found a Chrome extension forum and here I am. I have this as the options.html page:

    <html>
    <head>
    <title>Feed Options</title>
    <script type="text/javascript" src="options.js"></script>
    </head>
    <body onload="loadOptions()">
    <h1>Select your Feed.</h1>
    <select id="feed">
    <option value="theoatmeal">TheOatmeal</option>
    <option value="twitter">Twitter</option>
    </select>
    <br />
    <button onclick="saveOptions()">Save</button>
    <br />
    <button onclick="eraseOptions()">Restore default</button>
    </body>
    </html>

    Sorry I forgot the tag for putting that in a box.. It's fairly short so no harm should be done.

    Anyways, I need help with options.js. I'm a newbie to JavaScript, but this shouldn't be hard.

    Whenever you go to the options page and select 'Twitter' for example, I need it to display "popup2.html" instead of the default "popup.html"..

    -Jared

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

    Default

    Well you haven't shared any information on your extension or manifest or anything so no one can really help you.
    An options page is nothing by itself.
    ~ 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
    RubberBiscuit is offline Junior Member
    Join Date
    Jun 2010
    Posts
    2

    Default

    Here's my extension: https://chrome.google.com/extensions...fgalhbfdgmefi# It's a simple RSS reader.

    Manifest.json:

    {
    "name": "TheOatmeal Update Extension",
    "version": "1.2",
    "description": "Recent posts on TheOatmeal.",
    "icons": { "128": "icon128.png" },
    "browser_action": {
    "default_icon": "icon.png",
    "popup": "popup.html"
    },
    "permissions": [
    "http://theoatmeal.com/"
    ]
    }
    --------------------------------------------------------------------------------------
    popup.html:


    <style>
    body {
    background-image:url('theoatmeal.png');
    background-repeat:no-repeat;
    background-position:right bottom;
    min-width:400px;
    overflow-x:hidden;
    background-color:#efefef;
    }
    </style>
    <script language="JavaScript" src="http://feed2js.org//feed2js.php?src=http%3A%2F%2Ftheoatmeal.com%2Ffeed%2Frss&amp;chan=y&amp;num=4&amp;date=y&amp;targ=y& amp;utf=y" type="text/javascript"></script>

    <noscript>
    <a href="http://feed2js.org//feed2js.php?src=http%3A%2F%2Ftheoatmeal.com%2Ffeed%2Frss&amp;chan=y&amp;num=4&amp;date=y&amp;targ=y& amp;utf=y&amp;html=y">View RSS feed</a>
    </noscript>
    ------------------------------------------------------------------------
    popup2.html:


    <style>
    body {
    background-image:url('twitter.png');
    background-repeat:no-repeat;
    background-position:right bottom;
    min-width:400px;
    overflow-x:hidden;
    background-color:#efefef;
    }
    </style>

    <script language="JavaScript" src="http://feed2js.org//feed2js.php?src=http%3A%2F%2Ftwitter.com%2Fstatuses%2Fuser_timeline%2F4519121.rss&amp;chan=title&amp ;num=4&amp;date=y&amp;utf=y" type="text/javascript"></script>

    <noscript>
    <a href="http://feed2js.org//feed2js.php?src=http%3A%2F%2Ftwitter.com%2Fstatuses%2Fuser_timeline%2F4519121.rss&amp;chan=title&amp ;num=4&amp;date=y&amp;utf=y&amp;html=y">View RSS feed</a>
    </noscript>
    --------------------------------

    If I switch the popup in the manifest to 'popup2.html', it does what it's supposed to.

    On the options page I'm trying to add the selection so people can view the site's feed OR the twitter feed..

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

    Default

    You can change what the popup page is with the chrome.browserAction.setPopup function.
    For managing the options, I'd suggest having a Background Page that manages/applies them, and making your options page tell the Background Page the changes made when the user makes them. That way the BGP can apply the popup change and you'll have all the saving/loading of options in one file in case you need to change anything.
    You could also have a JS file they both include to achieve the same thing I guess. :T Whichever you like more.
    ~ 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. No options on some extensions
    By LeeU in forum Plugins Troubleshooting
    Replies: 1
    Last Post: 04-26-2010, 06:41 AM
  2. Lost options
    By zssr681 in forum Chrome Talk
    Replies: 1
    Last Post: 02-05-2010, 11:51 AM
  3. New "Simple New Tab Page" ?
    By seriosbrad in forum Plugins Troubleshooting
    Replies: 3
    Last Post: 12-03-2009, 07:18 PM
  4. Extension options - Now possible ?
    By Benni in forum Plugins Development
    Replies: 4
    Last Post: 10-31-2009, 06:16 AM
  5. [Bookmarklet] Crazy effect on Google Images
    By NicholasPufal in forum Chrome Plugins
    Replies: 4
    Last Post: 08-02-2009, 09:02 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
  •