New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

rm-plugin

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rm-plugin - npm Package Compare versions

Comparing version 0.0.11 to 0.0.13

42

index.js

@@ -25,3 +25,5 @@ var portalPostMessage;

getEventData: onGetEventData,
setBarTitle: onSetBarTitle
setBarTitle: onSetBarTitle,
setStorage: onSetStorage,
getStorage: onGetStorage
};

@@ -219,2 +221,38 @@

function onSetStorage({ key, value }) {
switch (platform) {
case PLATFORM_WEB_PORTAL:
portalPostMessage({
action: 'SET_COOKIE',
type: key,
message: value,
})
break;
}
}
function onGetStorage({ key, success, fail }) {
switch (platform) {
case PLATFORM_WEB_PORTAL:
portalPostMessage({
action: 'GET_COOKIE',
type: key,
})
window.addEventListener('message', function (event) {
if (typeof event.data !== 'string') return;
if (event.data.startsWith("{") && !event.data.startsWith("setImmediate")) {
const x = JSON.parse(event.data);
switch (x.action) {
case "GET_COOKIE":
success({ data: x.data });
break;
}
return;
}
}, false);
break;
}
}
export default {

@@ -237,2 +275,4 @@ getSignedRequest: onPrepareSignedRequest,

setBarTitle: onSetBarTitle,
setStorage: onSetStorage,
getStorage: onGetStorage,
PLATFORM_MOBILE_APP,

@@ -239,0 +279,0 @@ PLATFORM_TERMINAL,

@@ -32,3 +32,5 @@ "use strict";

getEventData: onGetEventData,
setBarTitle: onSetBarTitle
setBarTitle: onSetBarTitle,
setStorage: onSetStorage,
getStorage: onGetStorage
}; // util for sleep

@@ -332,2 +334,49 @@

function onSetStorage(_ref8) {
var key = _ref8.key,
value = _ref8.value;
switch (platform) {
case PLATFORM_WEB_PORTAL:
portalPostMessage({
action: 'SET_COOKIE',
type: key,
message: value
});
break;
}
}
function onGetStorage(_ref9) {
var key = _ref9.key,
success = _ref9.success,
fail = _ref9.fail;
switch (platform) {
case PLATFORM_WEB_PORTAL:
portalPostMessage({
action: 'GET_COOKIE',
type: key
});
window.addEventListener('message', function (event) {
if (typeof event.data !== 'string') return;
if (event.data.startsWith("{") && !event.data.startsWith("setImmediate")) {
var x = JSON.parse(event.data);
switch (x.action) {
case "GET_COOKIE":
success({
data: x.data
});
break;
}
return;
}
}, false);
break;
}
}
var _default = {

@@ -350,2 +399,4 @@ getSignedRequest: onPrepareSignedRequest,

setBarTitle: onSetBarTitle,
setStorage: onSetStorage,
getStorage: onGetStorage,
PLATFORM_MOBILE_APP: PLATFORM_MOBILE_APP,

@@ -352,0 +403,0 @@ PLATFORM_TERMINAL: PLATFORM_TERMINAL,

2

package.json
{
"name": "rm-plugin",
"version": "0.0.11",
"version": "0.0.13",
"type": "module",

@@ -5,0 +5,0 @@ "description": "",

@@ -66,2 +66,16 @@ # RM Plugin SDK <img alt="npm" src="https://img.shields.io/npm/v/rm-plugin">

// set storage by key and value
rm.setStorage({
key: 'test',
value: 'token',
})
// get storage by key name
rm.getStorage({
key: 'test',
success: function({ data }) {
console.log("content", data);
}
})
```

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