Set background chaining functionality to JS.