Fix bug when accessing canvas inside an iframe

Another attempt at fixing a bug in which fabric does not work when applied to canvas elements inside an iframe