apply function scope at content script