Giter Club home page Giter Club logo

blankshield's People

Contributors

andrewk avatar danielstjules avatar dnahodil avatar rattrayalex avatar shajith avatar spiritsack avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

blankshield's Issues

Integration best practice

What is the best place to invoke e.g. blankshield($('a[target=_blank]')); ?
To have all html parsed / DOM created by then I guess it should be done in document.onready.
But I wonder if its possible a user would click the unsafe link before its fixed (before the whole document is loaded and js run)?

Also at the moment the library doesn't support custom "target" attributes, e.g.target="MyNewWindow" - it'll open a new tab that will be vulnerable to the attack - I'm going to work on a patch for this issue.

event.preventDefault not working in Firefox

Hi,

I have event.preventDefault on links that open a new tab so the user has to fill in a form before they can see the content. It works fine in Chrome but in Firefox and Edge it still opens the new tab when they click the download links.

It works fine on my local version that has iTheme security disabled, but when I move it to my server an extra event handler is added which seems to be causing the problem.

https://seerene.harte.online/download-center - click the download links.

$('body').on('click', '.file-download', function (event) {
      if ($('.download-overlay').length !== 1) {
        return;
      }
      // Stop default action and bubbling
      event.preventDefault();
      event.stopPropagation();

      $('.download-overlay').find('.download-title').text($(this).attr('title'));
      $('.download-overlay').attr('data-file', $(this).attr('href'));

      $('.download-overlay').fadeIn(200);
      $('body').addClass('overlay-open');
    });

Problem when opening multiple windows at the same time

Hello, I am getting a null reference error when doing something like this:
urls.forEach(url => { blankshield.open(url, '_blank'); });
Looks like this is caused by the child.opener = null in iframeOpen function, preventing to execute this line for the second time and onwards.

Issue with SameSite=Strict cookie

In Chrome 65 (at least for Mac), blankshield will open a new tab/window (for unsafe targets) to the URL, but the new tab/window will not have some cookies/session information sent to the URL for that domain (as it did previous). This is because Chrome has added support for the cookie same-site flag and enforces the value. When the URL is opened via a blank page (the generated iframe), it will not send the same-site strict cookies.
This only really is an issue when opening a URL to a blank page which has the same domain as the opener (and the same-site flag is set on some cookies).
I can see the different between using blankshield and not using it (via clicking a link) and using the patched window.open vs native), as well as when it is being used and I right-click to open in a new tab. Every time blankshield is used.

Doesn't work in Safari 8

Neither the rel=noreferrer nor the window.open techniques appear to prevent tab-nabbing in Safari 8. Screencast of your demo page is attached.

2015-02-13 10_30_38

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.