Maybe you can try the following code (not tested):
// My plugin initializer
export default {
name: 'myPlugin',
initialize(container) {
// Reopen the router to add a didTransition hook
const router = container.lookup('router:main')
router.reopen({
doSomething: function() {
// Wait for rendering to be over. THIS DOESN'T WORK IN ALL CASES.
// In fact, there is no way to be sure rendering is complete, because
// a 'complete rendering' is meaningless (think about a looping DOM
// animation)
Ember.run.schedule('afterRender', null, () => {
// Do your stuff here
...
})
}.on('didTransition')
})
}
}