Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

iFrame Detection Popup

This repository contains JavaScript code that detects if a webpage is being loaded within an iFrame and displays a popup message recommending the user to view the page in a new tab. The purpose of this code is to ensure that the developer's work is properly viewed and graded by their teacher.

Usage

To use this code, simply include it in your webpage's JavaScript file or embed it directly within a <script> tag. When the webpage is loaded within an iFrame, a popup will be displayed with the following options:

"Open in New Tab": This button opens the current page in a new tab. "No, thanks": This button dismisses the popup without opening the page in a new tab.

I have since deployed this to a CDN, where you can use the following code to embed it into your HTML file!

<script src="https://cdn.statically.io/gh/SteadyStatus21/PopoutJS/main/popout.js" defer></script>

Requirements

This code requires a modern web browser with JavaScript support. It does not have any external dependencies and can be easily integrated into existing web projects.

License

This code was created by SteadyStatus21 in 2023. It is released under a license that allows reuse with proper credits. However, reuse of the code is prohibited if the credit is removed, or if a closed-source verison is published. Please make sure to provide proper credits if you decide to use this code in your own projects.

Contributing

If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request. Contributions are welcome and greatly appreciated!

Disclaimer

This code is provided as-is without any warranty. I (SteadyStatus21) and contributors cannot be held responsible for any damages or liabilities arising from the use of this code.

Acknowledgements

I want to thank my teacher for inspiring and motivating me to create this iFrame detection popup system.

About

Make the user pop the page out of the iFrame if they are embedding the page, but giving the user choice.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages