working functionality fro bith the browser and page action