Bring back autosaveElement functionality, add resource as supported protocal.

TODO: Needs to be tested and debugged.
popup is now set to window for content context.