Welcome guest, is this your first visit? Create Account now to join.
Page 2 of 9 FirstFirst 1234 ... LastLast
Results 11 to 20 of 83

This is a discussion on [New Ext] Better Gmail within the Chrome Plugins section, part of the Google Chrome category: I just installed the version from the link you posted and at no time does the content script use local ...


  1. #11
    PAEz's Avatar
    PAEz is offline Moderator
    Join Date
    Aug 2009
    Location
    Australia
    Posts
    656

    Default

    I just installed the version from the link you posted and at no time does the content script use local storage, the settings are hard coded...
    // used until options page works
    var filterSide = "right"; /* left, right, original */
    var filterPosition = "bottom"; /* bottom, top */
    var filterScroll = "true"; /* true, false */
    var friendConnectHide = "true"; /* true, false */
    ...just do the background method, messaging sucks but its doable.

  2. #12
    mg2's Avatar
    mg2
    mg2 is offline Senior Member
    Join Date
    Jun 2009
    Location
    Karlsruhe, Germany, Europe
    Posts
    328

    Default

    i thought they were hard-coded, but they aren't if you change smth in the options and save, the options stays.

    I don't know how to make the "background method". Can you give me some clues?
    BETTER GMAIL for Google Chrome

    Win7 RC1
    Google Chrome Dev latest version

  3. #13
    PAEz's Avatar
    PAEz is offline Moderator
    Join Date
    Aug 2009
    Location
    Australia
    Posts
    656

    Default

    I havent played with this in a bit but basically Background pages can access local storage so you should send a one time request to the background page asking for the variable/s you want and the background page gets them from local storage and sends them back.
    If you need more help, do you just want to send me what you have so far and Ill see what I can do? Im not the best but Im sure I can help you with this.
    http://code.google.com/chrome/extensions/messaging.html

    EDIT: OH, and the facebook (yuk) extensions options page IS saveing and loading the options, but at no time does the content script use them
    Last edited by PAEz; 12-13-2009 at 05:52 PM.

  4. #14
    mg2's Avatar
    mg2
    mg2 is offline Senior Member
    Join Date
    Jun 2009
    Location
    Karlsruhe, Germany, Europe
    Posts
    328

    Default

    Ok my current state is in the attachment. I tried making the response thingy with the ads.js and the background page, but can't make it work. So if you pls show me how it's done on this file maybe i'll understand it
    ps: do you have skype or some kind of im where we can discuss faster :P
    Attached Files Attached Files
    BETTER GMAIL for Google Chrome

    Win7 RC1
    Google Chrome Dev latest version

  5. #15
    PAEz's Avatar
    PAEz is offline Moderator
    Join Date
    Aug 2009
    Location
    Australia
    Posts
    656

    Default

    My quick response from looking at your code and the google docs would be..

    ads.js
    Code:
    (function() { 
    
    chrome.extension.sendRequest({variable: "ads"}, function(response) {
    if(response.answer == "1") {
    var css = ".iY .Bu:last-child > .nH {\n	height: 0px !important;\n	overflow: hidden !important;\n	width: 0px !important;\n}\n\n\n.iY .Bu:first-child + .Bu {\n	display: none !important;\n}\n\n\n.iY {\n	width: 100% !important;\n}\n\n\n\n\n.iY .Bu:last-child .nH > .nH > .nH:first-child {\n	position: absolute !important;\n	left: 12px!important;\n	top: -73px !important;\n	width: 100% !important;\n	font-size: 70% !important;\n}\n\n\n.iY .Bu:last-child .hj {\n	font-size: 100% !important;\n	margin: 0 auto !important;\n	float: right !important;\n	padding: 5px 8px 0px !important;\n	border-style: solid !important;\n	border-width: 0px !important;\n	border-bottom-width: 0px !important;\n	-moz-border-radius-topleft: 4px !important;\n	-moz-border-radius-topright: 4px !important;\n	position: relative;\n}\n.iY .Bu:last-child .hj:hover {\n	z-index: 2 !important;\n}\n.z .hj {\n	\n}\n.B .hj {\n	background: #C9EDCC !important;\n	border-color: #69C17D !important;\n}\n.C .hj {\n	background: #EEEEEE !important;\n	border-color: #CCCCCC !important;\n}\n\n\n.iC .hj {\n	font-size: 70% !important;\n	margin-right: 4px !important;\n}\n\n\n.hk {\n	float: left !important;\n	padding: 0 !important;\n}\n\n\n.hk span {\n	display: block !important;\n	width: auto !important;\n	height: 1.8em !important;\n	line-height: 1.8em !important;\n	padding: 0 8px !important;\n	border: 1px solid #BBBBBB !important;\n	border-left-color: #FFFFFF !important;\n	background: transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAoCAAAAAAa3c+rAAAAAXNSR0IArs4c6QAAABJJREFUCNdj+MnEQBT8CsUEIACgKQMyxVIz6AAAAABJRU5ErkJggg==) repeat-x left center !important;\n	color: #000000 !important;\n}\n.hk:first-child span {\n	-moz-border-radius-topleft: 3px !important;\n	-moz-border-radius-bottomleft: 3px !important;\n	border-left-color: #BBBBBB !important;\n}\n.hk:last-child span {\n	-moz-border-radius-topright: 3px !important;\n	-moz-border-radius-bottomright: 3px !important;\n}\n.hk u {\n	text-decoration: none !important;\n}\n.hk img {\n	margin-bottom: 2px !important;\n}\n\n\n\n.hk span:hover {\n	border-top-color: #939393 !important;\n	border-bottom-color: #939393 !important;\n}\n.hk:first-child span:hover {\n	border-left-color: #939393 !important;\n}\n.hk:last-child span:hover {\n	border-right-color: #939393 !important;\n}\n\n\n\n.hk span:active {\n	background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAoCAAAAAAa3c+rAAAAAXNSR0IArs4c6QAAABVJREFUCNdjeMzEQDTkZmJg+IlfDQBx9QI0/iX6wgAAAABJRU5ErkJggg==) !important;\n	border-top-color: #444444 !important;\n	border-bottom-color: #444444 !important;\n}\n.hk:first-child span:active {\n	border-left-color: #444444 !important;\n}\n.hk:last-child span:active {\n	border-right-color: #444444 !important;\n}\n\n\n\n.b8, .cd, .cc {\n	padding: 3px 0 !important;\n}\n\n.b8 .ve, .cd .ve, .cc .ve {\n	margin-left: 10px !important;\n	position: relative !important;\n	z-index: 1 !important;\n	background-color: #FFFFFF !important;\n	border: 2px solid #FFFFFF !important;\n	border-collapse: separate !important;\n	-moz-border-radius: 6px !important;\n}";
    if (typeof GM_addStyle != "undefined") {
    	GM_addStyle(css);
    } else if (typeof PRO_addStyle != "undefined") {
    	PRO_addStyle(css);
    } else if (typeof addStyle != "undefined") {
    	addStyle(css);
    } else {
    	var heads = document.getElementsByTagName("head");
    	if (heads.length > 0) {
    		var node = document.createElement("style");
    		node.type = "text/css";
    		node.appendChild(document.createTextNode(css));
    		heads[0].appendChild(node); 
    	}
    }
    }
    });
    })();
    background.html
    Code:
    <html>
      <script>
    chrome.extension.onRequest.addListener(
      function(request, sender, sendResponse) {
        console.log(sender.tab ?
                    "from a content script:" + sender.tab.url :
                    "from the extension");
        if (request.variable == "ads")
          sendResponse({answer: localStorage["ads"]});
        else
          sendResponse({}); // snub them.
      });
        
      </script>
    </html>
    Ill test it in a bit, I got to go out for a bit.

    ps: do you have skype or some kind of im where we can discuss faster :P
    No, I hate chat and I prefer discussions in public so others can learn....but Ill pm an email after

    EDIT: Ooops, just noticed after posting the background only set lads once...code updated
    Last edited by PAEz; 12-13-2009 at 06:28 PM.

  6. #16
    mg2's Avatar
    mg2
    mg2 is offline Senior Member
    Join Date
    Jun 2009
    Location
    Karlsruhe, Germany, Europe
    Posts
    328

    Default

    OMG it worked
    BUT i had to modify the background tab so:
    Code:
    <html>
      <script>
    chrome.extension.onRequest.addListener(
      function(request, sender, sendResponse) {
        console.log(sender.tab ?
                    "from a content script:" + sender.tab.url :
                    "from the extension");
        if (request.variable == "ads")
          sendResponse({answer: localStorage["ads"]});
        else
          sendResponse({}); // snub them.
      });
        
      </script>
    </html>
    BETTER GMAIL for Google Chrome

    Win7 RC1
    Google Chrome Dev latest version

  7. #17
    PAEz's Avatar
    PAEz is offline Moderator
    Join Date
    Aug 2009
    Location
    Australia
    Posts
    656

    Default

    Cool, notice I edited it 6 minutes before your post to exactly the same :P
    Now just add a bunch of if else's or a case statement to your background and you should be good to go.
    ....I didnt go anywhere I just hoped you'd do it yourself If you ever need any help Im happy to help someone that helps them self

  8. #18
    mg2's Avatar
    mg2
    mg2 is offline Senior Member
    Join Date
    Jun 2009
    Location
    Karlsruhe, Germany, Europe
    Posts
    328

    Default

    Could you please test if this is working for you: http://arendvr.com/folders4gmail/
    BETTER GMAIL for Google Chrome

    Win7 RC1
    Google Chrome Dev latest version

  9. #19
    PAEz's Avatar
    PAEz is offline Moderator
    Join Date
    Aug 2009
    Location
    Australia
    Posts
    656

    Default

    Not me .....too much hassle and I wouldnt use it

  10. #20
    hexid is offline Junior Member
    Join Date
    Oct 2009
    Posts
    6

    Default

    hmm...i got it to pull my first variable...

    but how would i get the 2nd-4th??

    background.html
    Code:
    <html>
      <script>
        chrome.extension.onRequest.addListener(
          function(request, sender, sendResponse) {
            console.log(sender.tab ?
                        "from a content script:" + sender.tab.url + " variable = " + request.variable :
                        "from the extension");
            if (request.variable == "side")
              sendResponse({side: localStorage["fbc_side"]});
            else if (request.variable == "position")
              sendResponse({position: localStorage["fbc_position"]});
            else if (request.variable == "scroll")
              sendResponse({scroll: localStorage["fbc_scroll"]});
            else if (request.variable == "connect")
              sendResponse({connect: localStorage["fbc_connect"]});
            else
              sendResponse({}); // snub them.
          });
      </script>
    </html>
    facebook.js
    Code:
    chrome.extension.sendRequest({variable: "side"}, function(response) {
    
      (function() {
        // change style of facebook
        function styleChange(css) {
          if (typeof GM_addStyle != "undefined") {
            GM_addStyle(css);
          } 
          else if (typeof PRO_addStyle != "undefined") {
            PRO_addStyle(css);
          } 
          else if (typeof addStyle != "undefined") {
            addStyle(css);
          } 
          else {
            var heads = document.getElementsByTagName("head");
            if (heads.length > 0) {
              var node = document.createElement("style");
              node.type = "text/css";
              node.appendChild(document.createTextNode(css));
              heads[0].appendChild(node); 
            }
          }
        };
    
        // used until options page works
        //var filterSide = "right"; /* left, right, original */
        var filterPosition = "bottom"; /* bottom, top */
        var filterScroll = "true"; /* true, false */
        var friendConnectHide = "true"; /* true, false */
      
        if(response.side == "right")
        {
          if(filterPosition == "top")
          {
            $("#home_filter_list").insertBefore("#pagelet_reqbox");
            styleChange("#home_filter_list\n{width: 100% !important; margin: 0px 0px 15px; float: !important; clear: !important;}\n\n#pagelet_reqbox, #pagelet_pymkbox, #pagelet_connectbox\n{float: left !important;}\n\n#home_stream\n{width:auto !important;}\n\n#content, #pagefooter\n{display: block !important;}");
          }
        
          else if(filterPosition == "bottom")
          {
            $("#home_filter_list").insertAfter("#pagelet_syndicationbox");
            styleChange("#home_filter_list\n{width: 100% !important; margin: 0px 0px 15px;}\n\n#home_stream\n{width:auto !important;}\n\n#content, #pagefooter\n{display: block !important;}");
          }    
          else
          {
          }
        }
        else if(response.side == "left")
        {
          if(filterPosition == "top")
          {
            $("#home_filter_list").insertBefore("#pagelet_reqbox");
            styleChange("#home_filter_list\n{width: 100% !important; display: block !important; margin: 0px 0px 15px;}\n\n#pagelet_reqbox, #pagelet_pymkbox, #pagelet_connectbox\n{float: left !important;}\n\n#home_stream\n{width:auto !important;}\n\n#home_left_column\n{float: right !important;}\n\n#content, #pagefooter\n{display: block !important;}");
          }
          else if(filterPosition == "bottom")
          {
            $("#home_filter_list").insertBefore("#pagelet_syndicationbox");
            styleChange("#home_filter_list\n{width: 100% !important; display: block !important; margin: 0px 0px 15px;}\n\n#home_stream\n{width:auto !important;}\n\n#home_left_column\n{float: right !important;}\n\n#content, #pagefooter\n{display: block !important;}");
          }
        }
        else if(response.side == "original")
        {
          if(filterScroll == "true")
          {
            styleChange("#home_filter_list\n{display: block !important; position: fixed !important;}\n\n#home_stream\n{float: right !important;}\n\n#home_sidebar\n{display: block;}\n\n#content, #pagefooter\n{display: block !important;}");
          }
          else if(filterScroll == "false")
          {
            styleChange("#home_filter_list\n{display: block !important;}\n\n#home_stream\n{float: right !important;}\n\n#home_sidebar\n{display: block;}\n\n#content, #pagefooter\n{display: block !important;}");
          }
        }
    
        if(friendConnectHide == "true")
        {
          styleChange("#pagelet_connectbox\n{display: none !important;}");
        }
      })();
    });

Page 2 of 9 FirstFirst 1234 ... LastLast

Similar Threads

  1. Cutting and Pasting Into Gmail
    By Professor K in forum Chrome Troubleshooting
    Replies: 12
    Last Post: 11-19-2009, 02:47 AM
  2. Chrome or gmail bug.. can't log in
    By Benni in forum Bugs and Vulnerabilities
    Replies: 4
    Last Post: 11-02-2009, 03:59 PM
  3. Gmail checker
    By toketin in forum Plugins Troubleshooting
    Replies: 5
    Last Post: 10-24-2009, 06:20 PM
  4. Gmail This Not Working
    By Hiqutipie in forum Plugins Troubleshooting
    Replies: 1
    Last Post: 08-19-2009, 06:36 PM
  5. Gmail delay
    By Growat in forum Chrome Talk
    Replies: 0
    Last Post: 11-05-2008, 03:20 PM

Posting Permissions

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