Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

msc-any-pip

Package Overview
Dependencies
Maintainers
0
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

msc-any-pip - npm Package Compare versions

Comparing version 1.0.9 to 1.0.10

mjs/wc-msc-any-pip.min.js

32

mjs/wc-msc-any-pip.js

@@ -12,5 +12,7 @@ import { _wcl } from './common-lib.js';

winwidth: 0,
winheight: 0
winheight: 0,
preferinitialwindowplacement: false,
disallowreturntoopener: false
};
const booleanAttrs = []; // booleanAttrs default should be false
const booleanAttrs = ['disallowreturntoopener', 'preferinitialwindowplacement']; // booleanAttrs default should be false
const objectAttrs = [];

@@ -206,2 +208,7 @@ const custumEvents = {

break;
case 'disallowreturntoopener':
case 'preferinitialwindowplacement':
this.#config[attrName] = true;
break;
}

@@ -283,2 +290,18 @@ }

set preferinitialwindowplacement(value) {
this.toggleAttribute('preferinitialwindowplacement', Boolean(value));
}
get preferinitialwindowplacement() {
return this.#config.preferinitialwindowplacement;
}
set disallowreturntoopener(value) {
this.toggleAttribute('disallowreturntoopener', Boolean(value));
}
get disallowreturntoopener() {
return this.#config.disallowreturntoopener;
}
#fireEvent(evtName, detail) {

@@ -311,6 +334,7 @@ this.dispatchEvent(new CustomEvent(evtName,

// pip
const delta = 30;
const pipWindow = await window?.documentPictureInPicture.requestWindow({
width: this.winwidth,
height: this.winheight + delta
height: this.winheight,
disallowReturnToOpener: this.disallowreturntoopener,
preferInitialWindowPlacement: this.preferinitialwindowplacement
});

@@ -317,0 +341,0 @@ _wcl.cloneStyleSheetsToDocument(pipWindow.document);

2

package.json
{
"name": "msc-any-pip",
"version": "1.0.9",
"version": "1.0.10",
"description": "Imaging what if we can let anything Picture-in-Picture (not only <video />) ?! Here comes <msc-any-pip /> to let it dream comes true. <msc-any-pip /> apply Document Picture-in-Picture API to given elements have Picture-in-Picture feature.",

@@ -5,0 +5,0 @@ "main": "index.html",

@@ -31,3 +31,5 @@ # msc-any-pip

"winwidth": 450,
"winheight": 300
"winheight": 300,
"disallowreturntoopener": false,
"preferinitialwindowplacement": false
}

@@ -79,3 +81,5 @@ </script>

winwidth: 450,
winheight: 300
winheight: 300,
disallowreturntoopener: false,
preferinitialwindowplacement: true
};

@@ -135,2 +139,22 @@ const nodeC = new MscAnyPip(config);

- **disallowreturntoopener**
Hides the "back to tab" button in the Picture-in-Picture window if true. It is false by default (not set).
```html
<msc-any-pip disallowreturntoopener>
...
</msc-any-pip>
```
- **preferinitialwindowplacement**
Open the Picture-in-Picture window in its default position and size if true. It is false by default (not set).
```html
<msc-any-pip preferinitialwindowplacement>
...
</msc-any-pip>
```
## Properties

@@ -142,2 +166,4 @@

| winheight | Number | Getter / Setter for Picture-in-Picture window height. Default is &lt;msc-any-pip />'s clientHeight. |
| disallowreturntoopener | Boolean | Getter / Setter for disallowreturntoopener. Hides the "back to tab" button in the Picture-in-Picture window if true. It is false by default. |
| preferinitialwindowplacement | Boolean | Getter / Setter for preferinitialwindowplacement. Open the Picture-in-Picture window in its default position and size if true. It is false by default. |

@@ -144,0 +170,0 @@ ## Mathod

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc