Nobody in their right mind is going to carefully peruse the cookies and injected JS scripts of every page they visit.
No, the onus is clearly on the developers, who are the ones with the professional responsibility to make software that abides by the laws.