Posts

Showing posts from September, 2015

jquery - First image on a Nivo Slider appears distorted -

i have nivo slider on site , every time reload first image on slider appears stretched height, don't know reason, defined max-height fixed value , have added height: auto !important; .nivo-main-image even facing same problem without solution, appreciate you'll. here code: ** .nivoslider { position:relative; width:100%; height:auto; overflow: hidden; } .nivoslider img { position:absolute; top:0px; left:0px; max-width: none; } .nivo-main-image { display: block !important; position: relative !important; width: 100% !important; height:auto !important; } /* if image wrapped in link */ .nivoslider a.nivo-imagelink { position:absolute; top:0px; left:0px; width:100%; height:100%; border:0; padding:0; margin:0; z-index:6; display:none; background:white; filter:alpha(opacity=0); opacity:0; } /* slices , boxes in slider */ .nivo-slice { display:block; positio

android - socket.io does'nt work on chrome mobile, but it does in incognito mode -

i'm working nodejs , socket.io under angularjs. the sockets work on desktop (all browsers). not on mobile. well... socket d'ont work on chrome mobile, expect in incognito mode. here bit of code: server side: io.on('connection', function(socket){ user = { id: socket.id, socket: socket }; console.log('connection received'); console.log(user.id); socket.emit('files', lib.all()); client side socket.on('files', function(data){ var streams = data; if(streams){ $scope.streams = streams; } }); the lib.all() function work fine. , i've got angular factory handle socket.io (which work fine). in chrome mobile socket not received or emit anything. work expected in incognito mode. work in firefox android. i'm not expert in android neither in chrome. suspect there special/strange happening. firewall? proxy? does know workaround this? thanks, , have day! p.s : on ch

Wordpress menu and WooCommerce categories -

is possible add categories/subcategories links automatically wp menu woocommerce plugin? have many categories (20) , more subcategories (100+) , need them shown in main menu @ top, in hierarchical way. have tried "appearance->menu" section select categories @ once in menu, messed up, no hierarchy @ all. there solution avoid inserting categories/subcategories manually menu items? please check plugin https://wordpress.org/plugins/jc-submenu/screenshots/ with need 1 time add menu showing screenshot

mocha - How to unit test file upload with Supertest -and- send a token? -

how can test file upload token being sent? i'm getting "0" instead of confirmation of upload. this failed test: var chai = require('chai'); var expect = chai.expect; var config = require("../config"); // contains call supertest , token info describe('upload endpoint', function (){ it('attach photos - should return 200 response & accepted text', function (done){ this.timeout(15000); settimeout(done, 15000); config.api.post('/customer/upload') .set('accept', 'application.json') .send({"token": config.token}) .field('vehicle_vin', "randomvin") .attach('file', '/users/moi/desktop/unit_test_extravaganza/hardwork.jpg') .end(function(err, res) { expect(res.body.ok).to.equal(true); expect(res.body.result[0].web_link).to.exist;

Chrome Application Doesn't Use System Proxy -

a chrome packaged application under windows 10 doesn't seem using public proxy settings under internet options. i'm trying monitor application's network activity via fiddler installed on computer. every http , https requests monitored there, except ones packaged application. i'm pretty sure uses http requests behind, because generated android apk file, using arc welder. , can see http requests android application on phone. not generated packaged chrome application on windows. there can manifest file or else? thank you. chrome.sockets api not use chrome browser proxy settings. on chromeos, chrome.sockets respect system-wide vpn settings, however.

facebook - FBSDKAppInviteDialog: How to know when a friend have accepted -

using fbsdkappinvitedialog how know when friend has accepted invitation? the result in following delegate method not give information: - (void)appinvitedialog:(fbsdkappinvitedialog *)appinvitedialog didcompletewithresults:(nsdictionary *)results{ so app know when "app friends". i know sure cannot ids or information friends invited using fbsdkappinvitedialog . more information in question: app invite dialog delegate methods result parameter contains no request id and i'm pretty sure there no way friends accepted invitation directly neither. use dynamic app link end point referral code, though. can have here: https://developers.facebook.com/docs/app-invites/ios#app_links the above applies if developing non-game app. easier if doing game. can use fbsdkgamerequestdialog or invitable_friends method of graph api, if want draw custom interface that. unrelated directly question, might interesting if trying implement kind of referral system: https://dev

javascript - Chrome + JSFiddle OPTION element bug -

Image
this has me scratching head. the option text cleared using code in snippet: document.queryselector('option').textcontent = ''; <select> <option>ipso</option> </select> it works in codepen , plus works on website. however, in jsfiddle fails – but in chrome . if set textcontent prior clearing it, it works . this issue doesn't seem occur other type of element. if use innertext or innerhtml instead of textcontent , same behavior – again, in chrome. jquery's text() method gives same behavior. is chrome bug or jsfiddle bug? i don't know reason bug, try setting load type (click cog in top right corner of javascript frame) , select no wrap - in <body> . it works on chrome browser on phone (whilst fiddle didn't), , possibly explain what's gone wrong.

angular2 services - Angular 2 RC 4 Http post not firing -

i trying fire post request app , it's not working, tried multiple ways. don't see request being fired under network tab in chrome. not sure problem is, appreciated. import { injectable } '@angular/core'; import { http, headers } '@angular/http'; @injectable() export class userservice{ private _url="users"; constructor(private _http: http){ } checkifusernameexists(username){ return this._http.get(this._url+"/"+username) .map(response => response.json()) } createuser(user){ let headers = new headers(); headers.append('content-type', 'application/json') console.log(json.stringify(user)); return this._http.post(this._url, json.stringify(user),{headers: headers}) .map(response => response.json()) } } first need capture error , solve error: this._http.post(this._url, json.stringify(user),{headers: headers}) .subscribe(

list comprehension with multiple conditions (python) -

the following code works in python var=range(20) var_even = [0 if x%2==0 else x x in var] print var,var_even however, thought conditions need put in end of list. if make code var_even = [0 if x%2==0 x in var] then won't work. there reason this? there 2 distinct similar-looking syntaxes involved here, conditional expressions , list comprehension filter clauses . a conditional expression of form x if y else z . syntax isn't related list comprehensions. if want conditionally include 1 thing or different thing in list comprehension, use: var_even = [x if x%2==0 else 'odd' x in var] # ^ "if" on here "this or that" a list comprehension filter clause if thing in elem x in y if thing . part of list comprehension syntax, , goes after for clause. if want conditionally include or not include element in list comprehension, use: var_even = [x x in var if x%2==0] # ^ "if" on here "

php - Beginner trouble updating records PDO -

i have read lot of articles/blogs cannot find wrong. trying update records using pdo when press send nothing happens, no error, , not work. php: $stmt = $conn->prepare('update products set name = :name id = :id'); $stmt->bindvalue(':id', $_post['id'], pdo::param_int); $stmt->bindvalue(':name', $_post['name'], pdo::param_str); $stmt->execute(); html: <form name="prodform" class="pure-form pure-form-aligned" method="post"> <input name="name" type="text" value="<?php echo $data['nome']; ?>"> <input name="id" type="hidden" value="<?php echo $data['id']; ?>"> <input name="send" type="submit" value="send"> </form> it seems found way make work don't know why works this. changed input name different 1 , worked magic, don't know why

sql server - How to make dynamic updates to the database using a list in python -

if year in year: #print 'executing' rows in range(1,sheet.nrows): records = [] fip = str(sheet.cell(rows, 1).value) cols in range(9,sheet.ncols): records.append(str(sheet.cell(rows,cols).value)) cur.execute("update " + str(table_name) + " set " + (str(variables[0]) + "= \'{0}\', ".format(records[0]) + str(variables[1]) + " = \'{0}\', ".format(records[1]) + str(variables[2]) + " = \'{0}\', ".format(records[2]) + str(variables[3]) + " = \'{0}\', ".format(records[3]) + str(variables[4]) + " = \'{0}\',".format(records[4]) + str(variables[5]) + " = \'{0}\', ".format(records[5]) + str(variables[6]) + " = \'{0}\' ".format(records[6])+ "where data_yea

javascript - Get data-value of each individual div -

i'm using couple of plugins animate progress bars using javascript. i'm setting data value of each 1 in html avoid defining in javascript each time. <div class="progress-circle" data-value="0.65"> i want data value animate , stop @ value each time code have @ moment stops of them @ 1st divs value. var el = $('.progress-circle'), inited = false; el.appear({ force_process: true }); el.on('appear', function() { if (!inited) { el.circleprogress({ value: el.attr('data-value') }); inited = true; } }); $('.progress-circle').circleprogress({ size: 80, startangle: -math.pi / 4 * 2, linecap: "round", fill: { color: "#64b46e" } }).on('circle-animation-progress', function(event, progress, stepvalue) { $(this).find('.inner').text(string(stepvalue.tofixed(2)).substr(2)+ '%'); }); how

javascript - Angular directive attributes cause an error -

i trying write angular directive make substring of attribute passed in. below code: html: <body ng-controller="mainctrl"> <div><substring message="this test."></substring></div> <div><substring message="so this." ></substring></div> </body> angular/javascript: var app = angular.module('myapp', []); app.controller('mainctrl', function($scope) { }); app.directive('substring', function () { return { restrict: 'ae', replace: true, scope: { text: '=message' }, link: function (scope, elem, attrs) { //alert(attrs.message); var str = attrs.message; scope.text = str.substring(1, 4); }, template: '<h1>{{text}}</h1>' }; }); when try running following error: html1300: navigation occurred. file: directive.html error: [$parse:syntax] syntax error: token 'is'

In Java, what is meant by this "double cannot be dereferenced" error? -

this question has answer here: double cannot dereferenced? 3 answers i have following code : public class randomcompliment { static final string[] comps = { "gorgeous butterfly!", "strawberry milkshake!", "calm waterfall", "smart cookie", "big genius", "friendly cat" }; public static void main(string[] args) { (int = 0; < 200 ; i++ ) { system.out.print("good monring, " + comps[(((20) * math.sin(i)).intvalue()) % comps.length]); } } } and giving me error : c:\misc_stuff\randomscratch>javac randomcompliment.java randomcompliment.java:14: double cannot dereferenced system.out.print(" " + comps[ ( ((20) * math. sin(i)).intvalue() ) % comps.length ]); ^ 1 error what meant "dereferenced" here

unity3d - C# OnTriggerEnter, Pick up an object. OnTriggerExit, drop the object -

i'm trying sprite pick cube when encounters one, if isn't carrying one. if is, drop cube carrying. this have right now. void ontriggerenter(collider other) { if (other.tag == "cube") { other.transform.position = this.transform.position; } } i tried telling cube become child of sprite. wasn't working. put cube sprites position when trigger entered, cube stays in position while sprite wonders off. with code,you can change cubes position players position 1 time.if want cube move character should make child of character. try using code; void ontriggerenter(collider other) { if (other.tag == "cube") { other.transform.parent = gameobject.transform; } } ps:i don't have access unity now.some coding mistakes can occur.

Splitting Date and specially Time in C#. How to get the AM/PM thing -

this question has answer here: how am/pm value datetime? 12 answers i have value #7/13/2016 3:20:00 pm# , want separate out date , time. format date "07/13/2016" , time "03:20 pm". have got values startdatetime.tostring("mm/dd/yyyy") , startdatetime.tostring("hh:mm") not sure "am or pm" thing. if understand correctly, have datetime value trying break separate date , time. microsoft has great documentation on datetime formatting think looking for time element this: somedatetime.tostring("hh:mm tt"); which should output "03:20 pm" or whatever case may be.

ios - How to change height of Annotation callout window Swift -

how change size of annotation callout window on map in swift. tried make bigger cgsize on each of component of right , left view without success height of view in end still same. here code: func mapview(mapview: mkmapview, viewforannotation annotation: mkannotation) -> mkannotationview? { print("delegate called") if !(annotation custompointannotation) { return nil } let reuseid = "test" var anview = mapview.dequeuereusableannotationviewwithidentifier(reuseid) if anview == nil { anview = mkannotationview(annotation: annotation, reuseidentifier: reuseid) selectedustanova = (annotation as! custompointannotation).ustanova anview!.canshowcallout = true } else { anview!.annotation = annotation } //set annotation-specific properties **after** //the view dequeued or created... let cpa = annotation as! custompointannotation anview!.image = uiimage(named:cpa.image

haskell - Parsing with Happy: left-recursion versus right-recursion -

section 2.2 of happy user manual advises use left recursion rather right recursion, because right recursion "inefficient". they're saying if try parse long sequence of items, right recursion overflow parse stack, whereas left recursion uses constant stack. canonical example given is items : item { $1 : [] } | items "," item { $3 : $1 } unfortunately, means list of items comes out backwards. now it's easy enough apply reverse @ end (although maddeningly annoying have everywhere parser called , rather once it's defined ). however, if list of items large, surely reverse also going overflow haskell stack? no? basically, how make can parse arbitrarily-large files , still results out in correct order? if want entire items reverse d every time, can define items : items_ {reverse $1} items_ : item { $1 : [] } | items_ "," item { $3 : $1 } reverse won't overflow stack.

c# - How to dynamically create drop down lists and enumerate them at view? asp.net MVC 5 -

i want create drop down list in foreach loop, , send list of drop downs view , enumerate them there. how can accomplish that? view bags hold one, instance have 3 location drop down lists, want loop through country, region, city, , create drop down each , send them view. note: it's not 3 locations, locations added dynamically pointer parent id, have list of parent locations final selected location (in example have city, , want backtrack country while creating appropriate drop down lists) i'm using asp.net mvc 5 thanks comments, solved issue using ajax track parent ids instead of using multiple drop downs , sending them view.

c# - Repository with Multiple Entities Creating a DTO -

doing c# code review here, , noticed developer doing join 5 additional tables, , inline iqueryable projection dto. tables being joined in repository user , appointment , communicationpreference , userproduct , , product . didn't design system, , i'm simplifying somewhat, let's go now. using entity framework , web api. this little long apologize, curious hear others' thoughts on matter. so these tables relate in each user has list of upcoming service appointments service products. userproduct table shows relationship between product , user, , product table shows kinds of products. communicationpreference deals how want contacted things when service due, if coming service product, how want contacted (phone email text etc). so developer joins these tables in repository itself, , creates dto called "userserviceoverviewdto" returned controller , front end , has information display in grid customer representative (who user is, upcoming appointments, produc

swift - Convert PFGeopoint lat and long from Parse to display current users distance in radius to other users onto a text label -

Image
the first image example of result returning , second image example of results page, 'distance' label need change in order display users distance. have users locations stored on parse pfgeopoint called "location" in lat , long. have tabelviewcell textlabel. users shown on vc , trying show how far these users current user in tinder. i have other users locations running in logs lat , long coordinates , have text label updating "distance" "[] km away!" must getting array returning empty. i have searched internet , can't seem figure out. tutorials obj c or json or add annotations in mapview. here code on usersresultsviewcontroller: var locationmanager : cllocationmanager! var latitude: cllocationdegrees = 0 var longitude: cllocationdegrees = 0 @ibaction func done(sender: uibarbuttonitem) { self.performseguewithidentifier("backtoprofile", sender: self) } @iboutlet var resultspagetableview: uitableview! var imagefiles =

Javascript inheritance/prototype confusion -

this question has answer here: understanding prototypal inheritance in javascript 5 answers i have question regarding inheritance/prototype in javascript, if there's 1 constructor contains 1 method "greeting", there's "greeting" method attached prototype of constructor, implementation use if 1 object created using constructor , calling method? method getting "overriden" or "shadowed"? short answer: yes, being overridden. from mdn: javascript objects dynamic "bags" of properties (referred own properties). javascript objects have link prototype object. when trying access property of object, property not sought on object on prototype of object, prototype of prototype, , on until either property matching name found or end of prototype chain reached. read on js inheritance , prototype chain.

Android app stopped unfortunately (Location) -

i struggling long fix users location in google maps activity. when runned once worked perfectly, marker spotted @ users location. ran again , app stops 2 errors in stack-trace. here errors: at com.doppler.stackingcoder.pechhulp.pechhulpactivity.onlocationchanged(pechhulpactivity.java:87) @ com.doppler.stackingcoder.pechhulp.pechhulpactivity.onmapready(pechhulpactivity.java:101) and here 2 methods have errors: @override public void onlocationchanged(location location) { latitude = location.getlatitude(); // line 87 longtitude = location.getlongitude(); } @override public void onmapready(googlemap googlemap) { mmap = googlemap; mmap.movecamera(cameraupdatefactory.zoomto(10)); mmap.getuisettings().setrotategesturesenabled(false); if (activitycompat.checkselfpermission(this, manifest.permission.access_fine_location) != packagemanager.permission_granted && activitycompat.checkselfpermission(this, manifest.permission.access_coarse_location) != p

spring - Java: Async MongoTemplate / MongoOperation -

is there way insert asynchronously mongodb? i know mongodb quick in cases, thought maybe can save milliseconds returning command given. it use cases connect server send mongodb command insert something. want return client once command issued , not wait response mongodb. i read documentation: http://docs.spring.io/spring-data/mongodb/docs/current/reference/html/ it seems read asynchronously, not insert asychronously. the spring data mongodb documentation shows example of using @async annotation on query methods, possible use on every method. quoting documentation: repository queries can executed asynchronously using spring’s asynchronous method execution capability. means method return upon invocation , actual query execution occur in task has been submitted spring taskexecutor. asynchronous invocation of methods not spring data concern spring core concern can refer spring framework documentation . simply said, need add @async annotation on method wan

gradle - Turn off debug menu on React Native Android apk Release -

i'm on rn 0.26 building apk so cd android && ./gradlew assemblerelease and keystore things in place generated app-release.apk app still in debug mode when install on device. errors , rage menu. i tried hard coding app/react.grade to def devenabled = false no luck. didn't used happen used on rn 0.13. try executing before generate release apk react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/

swift - Volume Control iOS -

while using snapchat, noticed when volume changed while playing video or snap obtrusive volume box in middle of screen didn't show , instead replaced smaller bars @ top of screen. how can create similar result (basically, removing obtrusive volume box centre of screen) app? yeah there few workarounds people disliking question because there not information , kind of simple find answer to, nonetheless, should answer question. controlling system output volume mpvolumeview class (part 1) cheers!

Creating a port between content script and browser action javascript in Chrome extension -

in order detect when browser action closes in chrome extension, i'm creating connection between browser action javascript , background script, , using port.ondisconnect . alert tab's content script of closing using tabs.sendmessage . there way can create port between content script , browser action javascript remove need background page?

ibm bluemix - Is MQ Light truely a message queue? -

we running node.js app on bluemix uses mqlight service. are messages being queued in case there no receivers? possible receiver fetch messages sent before connected? are messages being queued in case messages being sent faster handled? using time-to-live property of messages, messages can persisted on destination topic until subscriber connects. allow buffer messages whilst no subscribers. full details property available here .

python - multiprocessing module and distinct psycopg2 connections -

i puzzled behavior of multiprocessing code using psycopg2 make queries in parallel postgres db. essentially, making same query (with different params) various partitions of larger table. using multiprocessing.pool fork off separate query. my multiprocessing call looks this: pool = pool(processes=num_procs) results=pool.map(run_sql, params_list) my run_sql code looks this: def run_sql(zip2): conn = get_connection() curs = conn.cursor() print "conn: %s curs:%s pid=%s" % (id(conn), id(curs), os.getpid()) ... curs.execute(qry) records = curs.fetchall() def get_connection() ... conn = psycopg2.connect(user=db_user, host=db_host, dbname=db_name, password=db_pwd) return conn so expectation each process separate db connection via call get_connection() , print id(conn) display distinct value. however, doesn't seem case , @ loss explain it. print id(curs) same. print os.getpid() shows difference.

java - Override method from assigned class -

i want override method class that's assigned variable. example: inventory = new inventory( ); /* code here changes how inventory must behave or whatever */ inventory { @override ... } is possible ??? maybe think of (instead of null-if implement default strategy make more clean): public interface strategy { public void dosomething(); } public class inventory { strategy strategy; public inventory() { // ... } public void dosomething() { if (strategy == null) { system.out.println("strategy empty"); } else { strategy.dosomething(); } } public strategy getstrategy() { return strategy; } public void setstrategy(strategy strategy) { this.strategy = strategy; } } then this inventory inventory = new inventory(); inventory.dosomething(); inventory.setstrategy(new strategy() { @override public void dosomet

reactjs - Flux, how to correctly reuse components? -

still studying flux, i'm in trouble logic store. let's i've created component, single button manage vote, switch "yes"/"no". so have votebutton manage voteaction use dispatcher call store function change votedbyviewer state. all it's fun , it's right... if have single button. if have multiples, share same store , re-render happen on multiples components. this initial js: // parse div react management $("#be-content [id*=like]").each(function (index) { var div_id = $(this).attr("id"); // render votebutton reactdom.render( <votebutton />, document.getelementbyid(div_id) ) }); each votebutton correctly rendered in page each switch change state of buttons. votebutton: var votestore = require('../stores/votestore') ; var voteactions = require('../actions/voteactions'); var votebutton = react.createclass({ getinitialstate: function () { return {

javascript - Child div not disappearing with visibility hidden -

my code involves having div in div, , when set both of visibilities hidden, parent div disappears. in debugging attempt, tried print out visibility of child div, , has 'visibility: hidden'. #popup { visibility: visible; margin: auto; position: fixed; background-color: black; padding-top: 5px; padding-bottom: 5px; padding-left: .5%; padding-right: .5%; border-radius: 4px; left: 14.5%; top: 20px; width: 70%; height: 450px; } #redx { visibility: visible; position: absolute; right: 0px; top: 0px; width: 35px; height: 35px; text-align: center; font-size: 25px; font-weight: bold; color: white; background-color: red; transition: .2s color ease-out; } ------------------------------------------------ // how control styles in changepopupvisibility() var popup = document.getelementbyid('popup'); var redx = document.getelementbyid('redx'); var popupope

java - Zookeeper in-memory log -

does zookeeper have "in-memory log"? i've experience zookeeper never seen before (from client side), , after searching haven't found related in-memory log. far know, every operation (create, setdata, delete) made on disk. however, in paper ravana: controller fault-tolerance in software-defined networking authors event logging: master saves each event in zookeeper’s distributed in-memory log. slaves monitor log registering trigger it. when new event propagated slave’s log, trigger activated slave can read newly arrived event locally. so, assuming there in-memory log, how (java) client app use it? or server side only?

uinavigationcontroller - NavigationController.pushViewController in Custom Segue does not work - Swift 2.0 - iOS 9.1 -

Image
i'm writing custom segue in uistoryboardsegue. use catransition create right left custom animation. if used sourceviewcontroller.navigationcontroller?.pushviewcontroller(destinationviewcontroller, animated: false); , not take me second view. performs right left animation , stays on first view. have debugged code, , found sourceviewcontroller.navigationcontroller nil. have uinavigationcontroller between first view , second view. i have tried replace line of code sourceviewcontroller.presentviewcontroller(destinationviewcontroller, animated: false, completion: nil); . transition happen, happens fast can't see right left animation. my complete code in uistoryboardsegue following: override func perform() { let sourceviewcontroller = self.sourceviewcontroller uiviewcontroller; let destinationviewcontroller = self.destinationviewcontroller uiviewcontroller; let transition: catransition = catransition() transition.duration = 0.25; transition.timingfunc

qt - See which style of stylesheet is applied to particular element -

i use stylesheets ( qss ) qt application. there way see style applied particular element (widget)? can use trial , error, easier if see style used / applied. the stylesheet property empty. there way debug style stylesheet applied? you can stylesheets applied yourself. qt doesn't operate stylesheets. use qstyle + qpalette customization. may through code , understand how widgets painted.

plsql - Exception handling PL SQL -

my application has following 2 procedure handles entire transaction. when nested procedure throws exception crud operation performed in outer procedure not roll back. please me re arrange or how write in better way can roll transaction. procedure sp_send_case_next_level ( p_wfid in number, p_assessmentid in number, p_prevlevelid in number, p_apptype in number, p_sequencenumber in number, p_subsequencenumber in number, p_usercode in varchar2, p_companycode in varchar2, p_camnumber in varchar2, p_reviewtype in number, p_unittype in number, p_regioncode in number, p_casetype in varchar2, p_isapproved in varchar2, p_fromusercode in varchar2, p_errordetail out varchar2 ) v_newlevelid number(8); v_newwfid number(8); v_stepcompleted number(2); v_casecomplete varchar2(1); v_isstepcomplete varchar2(1); v

jquery - Chrome Extension Content Script to access chrome.storage -

i've created custom menu appended page using chrome extensions content script. extension works great , menu appear wanted. i want go little further , add options page on/off switch define var menutoggle either 1 or 0, , var attached if condition: if menutoggle == 1 // else // console.log("var 0, menu not loaded"); i able make work on extension environment using "localstorage.menutoggle = 1;" , understand work instance inside extension , content script not able access var. i went through official docs chrome.storage api honestly, didn't understand since i'm on stage of programming. from saw should use chrome.storage.sync.set this, didn't quite how set , either how retrieve data once inside content script. tried bellow, didn't work : chrome.storage.sync.set({'menutoggle': '1'}, function(){}); question here: need define function after sync.set? possible store data without function after it? bellow code used lo