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

bili-small-game

Package Overview
Dependencies
Maintainers
1
Versions
194
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bili-small-game - npm Package Compare versions

Comparing version 1.0.16 to 1.0.17

lib/adapter.android.opendata.js

52

lib/adapter.android.js

@@ -8,3 +8,3 @@ // This file is always executed before the App's index.js. It sets up most of

// Make 'window' the global scope
self = window = this;
GameGlobal = self = window = this;
window.top = window.parent = window;

@@ -20,8 +20,35 @@

// Create the default screen canvas
var screenCanvas = new BiliGame.Canvas.Instance();
var screenCanvas = window.canvas;
screenCanvas.style = {};
window.canvas = screenCanvas;
window.sharedCanvas = new BiliGame.Canvas.Instance();
sharedCanvas.style = {};
sharedCanvas.getContext('2d');
if (window.sharedCanvas) {
var sharedCanvas = window.sharedCanvas;
sharedCanvas.style = {};
var _realSharedCanvas = BiliUtils.getSharedCanvas();
sharedCanvas.getContext = _realSharedCanvas.getContext.bind(_realSharedCanvas);
Object.defineProperties(sharedCanvas, {
width: {
get() {
return _realSharedCanvas.width;
},
set(value) {
return _realSharedCanvas.width = value;
},
enumerable: true,
configurable: false,
},
height: {
get() {
return _realSharedCanvas.height;
},
set(value) {
return _realSharedCanvas.height = value;
},
enumerable: true,
configurable: false,
},
});
} else {
window.sharedCanvas = new (function() {return this})();
}
var onScreen = true;

@@ -78,3 +105,16 @@ window.__SmallApp.fileSystemManager = new BiliGame.FileSystemManager.Instance();

var openDataContext = {
canvas: sharedCanvas,
postMessage: function(data) {
if (window._postMessageToOpenDataContext) {
_postMessageToOpenDataContext(JSON.stringify(data));
}
},
};
var bl = (window.bl = {
postMessage: openDataContext.postMessage,
getOpenDataContext: function() {
return openDataContext;
},
createCanvas: function() {

@@ -81,0 +121,0 @@ if (onScreen) {

@@ -8,3 +8,3 @@ // This file is always executed before the App's index.js. It sets up most of

// Make 'window' the global scope
self = window = this;
GameGlobal = self = window = this;
window.top = window.parent = window;

@@ -16,7 +16,53 @@

var IS_NEW_VERSION = !!_internalBL.hasOpenDataContext;
// Create the default screen canvas
var screenCanvas = _internalBL.createCanvas();
window.canvas = screenCanvas;
window.sharedCanvas = _internalBL.createCanvas();
window.sharedCanvas.getContext('2d');
if (IS_NEW_VERSION) {
// 5.43新增开放域
if (_internalBL.hasOpenDataContext()) {
// 开启开放域
var _sharedCanvas = _internalBL.getRealOpenDataCanvas();
var fakeSharedCanvas = _internalBL.getFakeOpenDataCanvas();
fakeSharedCanvas.__proto__ = new (function() {
return this;
})();
fakeSharedCanvas.getContext = function(type) {
return _sharedCanvas.getContext(type);
};
Object.defineProperties(fakeSharedCanvas, {
width: {
get() {
return _sharedCanvas.width;
},
set(value) {
return (_sharedCanvas.value = value);
},
enumerable: true,
configurable: false,
},
height: {
get() {
return _sharedCanvas.height;
},
set(value) {
return (_sharedCanvas.height = value);
},
enumerable: true,
configurable: false,
},
});
window.sharedCanvas = fakeSharedCanvas;
} else {
window.sharedCanvas = new (function() {
return this;
})();
}
} else {
window.sharedCanvas = _internalBL.createCanvas();
window.sharedCanvas.getContext('2d');
}
var onScreen = true;

@@ -168,2 +214,19 @@

if (IS_NEW_VERSION) {
var postMessage = function(data) {
_internalBL.postMessageToOpenData(JSON.stringify(data));
};
var openDataContext = {
canvas: fakeSharedCanvas,
postMessage: postMessage,
};
bl.getOpenDataContext = function() {
return openDataContext;
};
bl.postMessage = postMessage;
}
window.localStorage = {};

@@ -170,0 +233,0 @@ // Timers

2

package.json
{
"name": "bili-small-game",
"version": "1.0.16",
"version": "1.0.17",
"description": "bilibili small game",

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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