mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-11 01:28:00 +01:00
Merge pull request #407 from Deathamns/ports/safari
Safari: fetch data from Info.plist for vAPI.app
This commit is contained in:
commit
dd4f9ae652
1 changed files with 8 additions and 2 deletions
|
@ -36,9 +36,15 @@ vAPI.safari = true;
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
|
var xhr = new XMLHttpRequest;
|
||||||
|
xhr.overrideMimeType('application/x-javascript;charset=utf-8');
|
||||||
|
xhr.open('GET', 'Info.plist', false);
|
||||||
|
xhr.send();
|
||||||
|
xhr = xhr.responseText;
|
||||||
|
|
||||||
vAPI.app = {
|
vAPI.app = {
|
||||||
name: 'µBlock',
|
name: xhr.match(/DisplayName<\S+[^>]+>([^<]+)/)[1],
|
||||||
version: '0.7.2.0'
|
version: xhr.match(/ShortVersionString<\S+[^>]+>([^<]+)/)[1]
|
||||||
};
|
};
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
Loading…
Reference in a new issue