Skip to content

Designed to demonstrate simple iFrame state collection in a parent angular application.

License

Notifications You must be signed in to change notification settings

randycasburn/iframe-freddie

Repository files navigation

The App is a very simple demonstration of state following in an iFrame

This project assumes same origin of iframe content

Key requirements:

  • do not show the parameters used within the iFrame in the main navigation bar
  • ensure bookmarking preserves the same view in the iFrame that existed when bookmarked

Solution:

An iframe directive tracks clicks on anchor tags within the iFrame. The hash of each link is recorded in localStorage. Upon returning to the page, the directive sets the href property by including the hash from localStorage. This simple technique satisfies both requirements.

Query parmeters question

What about query parameters. Use the same technique: 1. store the query string in localStorage; 2. Allow the iframe directive to reconstruct the URL with the query string attached.

Topics NOT addressed - Same Origin Policy and CORS

About

Designed to demonstrate simple iFrame state collection in a parent angular application.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published