Depends on the pages. There is always $PAGE->pagelayout that contains the name of the layout being used, i.e. 'admin', 'course', 'incourse' etc.
General developer forum
Call javascript (AMD) on specific pages not my own
This discussion has been locked so you can no longer reply to it.