Added page detection into main.js

Easier way to check what page you're on