Skip to content

Commit d734981

Browse files
committed
fix for modern browser edge and ie
1 parent c01a71b commit d734981

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

skin/src/index.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
import drawSkin3D from './namemc-skins';
22

3+
function findGetParameter(parameterName) {
4+
let result = null;
5+
let tmp = [];
6+
const items = window.location.search.substr(1).split('&');
7+
for (let index = 0; index < items.length; index += 1) {
8+
tmp = items[index].split('=');
9+
if (tmp[0] === parameterName) result = decodeURIComponent(tmp[1]);
10+
}
11+
return result;
12+
}
13+
314
const canvas = document.getElementById('skin');
4-
const url = new URL(window.location.href);
5-
const uuid = url.searchParams.get('uuid');
15+
const uuid = findGetParameter('uuid');
616

717
if (uuid && uuid.length === 32) {
818
const w = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);

web/src/components/PlayerPage.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<div class="panel panel-default">
1616
<div class="panel-body">
1717
<img v-if="!isCanvasSupported" :src="`/static/data/${uuid}/body.png`" :alt="`${player.data.playername}'s model`" class="img-rounded">
18-
<iframe v-if="isCanvasSupported" :src="`/static/skin/index.html?uuid=${uuid}`" class="skin" />
18+
<iframe v-if="isCanvasSupported" :src="`/static/skin/index.html?uuid=${uuid}`" class="skin" scrolling="no" />
1919
</div>
2020
</div>
2121
</div>

0 commit comments

Comments
 (0)