Added helper function extensionStateChange to avoid code duplication
Added helper function extensionStateChange to avoid code duplication

Function description should be multine comment

SummerWish/privly-chrome,smcgregor/privly-chrome,YagoGG/privly-chrome,smcgregor/privly-chrome,hitesh96db/privly-chrome,smcgregor/privly-chrome,privly/privly-chrome,hitesh96db/privly-chrome,privly/privly-chrome,SummerWish/privly-chrome,SummerWish/privly-chrome,hitesh96db/privly-chrome,privly/privly-chrome,YagoGG/privly-chrome,YagoGG/privly-chrome