Got monstrosity more or less working using Chrome's messaging API. Crashes on certain sites.