Readme, some fixes, rel noopener for _blank links
This commit is contained in:
1 parent
2087e56626
commit
18e7955b12
12 files changed
+82
-27
No files matched your search
@@ -214,7 +214,7 @@ namespace Documents\Example {
|
||||
}
|
||||
|
||||
public function getCode(): string {
|
||||
$view = $this->getDocument()->getView() ?? "<Empty>";
|
||||
$view = $this->getDocument()->getRequestedView() ?? "<Empty>";
|
||||
return "<b>Requested View:</b> " . htmlspecialchars($view);
|
||||
}
|
||||
}
|
||||
@@ -223,6 +223,48 @@ namespace Documents\Example {
|
||||
|
||||
Of course, the head and body classes can be placed in any file, as the code might get big and complex.
|
||||
|
||||
### Localization
|
||||
|
||||
Currently, there are two languages specified, which are stored in the database: `en_US` and `de_DE`.
|
||||
A language is dynamically loaded according to the sent `Accept-Language`-Header, but can also be set using the `lang` parameter
|
||||
or [/api/language/set](/core/Api/LanguageAPI.class.php) endpoint. Localization of strings can be achieved using the [LanguageModule](/core/Objects/lang/LanguageModule.php)-Class.
|
||||
Let's look at this example:
|
||||
|
||||
```php
|
||||
class ExampleLangModule extends \Objects\lang\LanguageModule {
|
||||
public function getEntries(string $langCode) {
|
||||
$entries = array();
|
||||
switch ($langCode) {
|
||||
case 'de_DE':
|
||||
$entries["EXAMPLE_KEY"] = "Das ist eine Beispielübersetzung";
|
||||
$entries["Welcome"] = "Willkommen";
|
||||
break;
|
||||
default:
|
||||
$entries["EXAMPLE_KEY"] = "This is an example translation";
|
||||
break;
|
||||
}
|
||||
return $entries;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
If any translation key is not defined, the key is returned, which means, we don't need to specify the string `Welcome` again. To access the translations,
|
||||
we firstly have to load the module. This is done by adding the class, or the object inside the constructor.
|
||||
To translate the defined strings, we can use the global `L()` function. The following code snipped shows the use of
|
||||
our sample language module:
|
||||
|
||||
```php
|
||||
class SomeView extends \Elements\View {
|
||||
public function __construct(\Elements\Document $document) {
|
||||
parent::__construct($document);
|
||||
$this->langModules[] = ExampleModule::class;
|
||||
}
|
||||
|
||||
public function getCode() : string{
|
||||
return L("Welcome") . "! " . L("EXAMPLE_KEY");
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Anything more?
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ export default function Sidebar(props) {
|
||||
let filePath = parent.filesPath;
|
||||
if (filePath) {
|
||||
li.push(<li className={"nav-item"} key={"files"}>
|
||||
<a href={filePath} className={"nav-link"} target={"_blank"} rel={"noopener noreferrer"}>
|
||||
<a href={filePath} className={"nav-link"} target={"_blank"} rel={"noopener"}>
|
||||
<Icon icon={"folder"} className={"nav-icon"} />
|
||||
<p>Files</p>
|
||||
</a>
|
||||
|
||||
@@ -121,7 +121,13 @@ export default function HelpPage() {
|
||||
<b>Project Lead & Main Developer</b>
|
||||
<ul className={"list-unstyled"}>
|
||||
<li><small><Icon icon={"address-card"} className={"mr-1"}/>Roman Hergenreder</small></li>
|
||||
<li><small><Icon icon={"globe"} className={"mr-1"}/><a href={"https://romanh.de/"} target={"_blank"}>https://romanh.de/</a></small></li>
|
||||
<li>
|
||||
<small><Icon icon={"globe"} className={"mr-1"}/>
|
||||
<a href={"https://romanh.de/"} target={"_blank"} rel={"noopener"}>
|
||||
https://romanh.de/
|
||||
</a>
|
||||
</small>
|
||||
</li>
|
||||
<li><small><Icon icon={"envelope"} className={"mr-1"}/><a href={"mailto:webmaster@romanh.de"}>webmaster@romanh.de</a></small></li>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -422,7 +422,7 @@ export default class Settings extends React.Component {
|
||||
<label className={"form-check-label"} htmlFor={"recaptcha_enabled"}>
|
||||
Enable Google's reCaptcha
|
||||
<span className={"ml-2"}>
|
||||
(<a href={"https://www.google.com/recaptcha/intro/v3.html"} target={"_blank"}>
|
||||
(<a href={"https://www.google.com/recaptcha/intro/v3.html"} target={"_blank"} rel={"noopener noreferrer"}>
|
||||
More Info
|
||||
<sup><small><Icon icon={"external-link-alt"} className={"ml-1"}/></small></sup>
|
||||
</a>)
|
||||
|
||||
@@ -27,12 +27,17 @@ abstract class Document {
|
||||
|
||||
public function getView() : ?View {
|
||||
|
||||
$file = getClassPath($this->activeView);
|
||||
if(!file_exists($file) || !is_subclass_of($this->activeView, View::class)) {
|
||||
$view = parseClass($this->activeView);
|
||||
$file = getClassPath($view);
|
||||
if(!file_exists($file) || !is_subclass_of($view, View::class)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new $this->activeView($this);
|
||||
return new $view($this);
|
||||
}
|
||||
|
||||
public function getRequestedView(): string {
|
||||
return $this->activeView;
|
||||
}
|
||||
|
||||
function getCode(): string {
|
||||
|
||||
@@ -89,7 +89,7 @@ abstract class View extends StaticView {
|
||||
|
||||
protected function createExternalLink($link, $title=null): string {
|
||||
if(is_null($title)) $title=$link;
|
||||
return "<a href=\"$link\" target=\"_blank\" class=\"external\">$title</a>";
|
||||
return "<a href=\"$link\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"external\">$title</a>";
|
||||
}
|
||||
|
||||
protected function createIcon($icon, $type = "fas", $classes = ""): string {
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace Objects;
|
||||
|
||||
abstract class ApiObject implements \JsonSerializable {
|
||||
|
||||
public abstract function jsonSerialize();
|
||||
public abstract function jsonSerialize(): array;
|
||||
|
||||
public function __toString() { return json_encode($this); }
|
||||
|
||||
|
||||
@@ -31,7 +31,10 @@ namespace Objects {
|
||||
public function getEntries() { return $this->entries; }
|
||||
public function getModules() { return $this->modules; }
|
||||
|
||||
public function loadModule(LanguageModule $module) {
|
||||
/**
|
||||
* @param $module LanguageModule class or object
|
||||
*/
|
||||
public function loadModule($module) {
|
||||
if(!is_object($module))
|
||||
$module = new $module;
|
||||
|
||||
@@ -40,7 +43,7 @@ namespace Objects {
|
||||
$this->modules[] = $module;
|
||||
}
|
||||
|
||||
public function translate($key) {
|
||||
public function translate(string $key): string {
|
||||
if(isset($this->entries[$key]))
|
||||
return $this->entries[$key];
|
||||
|
||||
@@ -51,7 +54,7 @@ namespace Objects {
|
||||
setcookie('lang', $this->langCode, 0, "/", "");
|
||||
}
|
||||
|
||||
public function jsonSerialize() {
|
||||
public function jsonSerialize(): array {
|
||||
return array(
|
||||
'uid' => $this->languageId,
|
||||
'code' => $this->langCode,
|
||||
|
||||
@@ -28,7 +28,7 @@ class Session extends ApiObject {
|
||||
$this->csrfToken = $csrfToken ?? generateRandomString(16);
|
||||
}
|
||||
|
||||
public static function create($user, $stayLoggedIn) {
|
||||
public static function create($user, $stayLoggedIn): ?Session {
|
||||
$session = new Session($user, null, null);
|
||||
if($session->insert($stayLoggedIn)) {
|
||||
return $session;
|
||||
@@ -69,15 +69,15 @@ class Session extends ApiObject {
|
||||
setcookie('session', $sessionCookie, $this->getExpiresTime(), "/", "", $secure);
|
||||
}
|
||||
|
||||
public function getExpiresTime() {
|
||||
public function getExpiresTime(): int {
|
||||
return ($this->stayLoggedIn == 0 ? 0 : $this->expires);
|
||||
}
|
||||
|
||||
public function getExpiresSeconds() {
|
||||
public function getExpiresSeconds(): int {
|
||||
return ($this->stayLoggedIn == 0 ? -1 : $this->expires - time());
|
||||
}
|
||||
|
||||
public function jsonSerialize() {
|
||||
public function jsonSerialize(): array {
|
||||
return array(
|
||||
'uid' => $this->sessionId,
|
||||
'user_id' => $this->user->getId(),
|
||||
@@ -89,7 +89,7 @@ class Session extends ApiObject {
|
||||
);
|
||||
}
|
||||
|
||||
public function insert($stayLoggedIn) {
|
||||
public function insert($stayLoggedIn): bool {
|
||||
$this->updateMetaData();
|
||||
$sql = $this->user->getSQL();
|
||||
|
||||
|
||||
+5
-5
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
define("WEBBASE_VERSION", "1.2.2");
|
||||
define("WEBBASE_VERSION", "1.2.3");
|
||||
|
||||
function getProtocol() {
|
||||
function getProtocol(): string {
|
||||
return (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https" : "http";
|
||||
}
|
||||
|
||||
@@ -26,12 +26,12 @@ function generateRandomString($length): string {
|
||||
return $randomString;
|
||||
}
|
||||
|
||||
function startsWith($haystack, $needle) {
|
||||
function startsWith($haystack, $needle): bool {
|
||||
$length = strlen($needle);
|
||||
return (substr($haystack, 0, $length) === $needle);
|
||||
}
|
||||
|
||||
function endsWith($haystack, $needle) {
|
||||
function endsWith($haystack, $needle): bool {
|
||||
$length = strlen($needle);
|
||||
if ($length == 0)
|
||||
return true;
|
||||
@@ -97,7 +97,7 @@ function createError($msg) {
|
||||
return json_encode(array("success" => false, "msg" => $msg));
|
||||
}
|
||||
|
||||
function serveStatic(string $webRoot, string $file) {
|
||||
function serveStatic(string $webRoot, string $file): string {
|
||||
|
||||
$path = realpath($webRoot . "/" . $file);
|
||||
if (!startsWith($path, $webRoot . "/")) {
|
||||
|
||||
@@ -141,12 +141,11 @@ if(isset($_GET["api"]) && is_string($_GET["api"])) {
|
||||
$response = serveStatic($currentDir, $target);
|
||||
break;
|
||||
case "dynamic":
|
||||
$view = parseClass($extra);
|
||||
$file = getClassPath($target);
|
||||
if(!file_exists($file) || !is_subclass_of($target, Document::class)) {
|
||||
$document = new Document404($user, $view);
|
||||
if (!file_exists($file) || !is_subclass_of($target, Document::class)) {
|
||||
$document = new Document404($user, $extra);
|
||||
} else {
|
||||
$document = new $target($user, $view);
|
||||
$document = new $target($user, $extra);
|
||||
}
|
||||
|
||||
$response = $document->getCode();
|
||||
|
||||
Vendored
+1
-1
@@ -351,4 +351,4 @@ e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月
|
||||
*
|
||||
* Copyright © 2012-2019 Faisal Salman <f@faisalman.com>
|
||||
* Licensed under MIT License
|
||||
*/!function(o,a){"use strict";var i="model",s="name",c="type",l="vendor",d="version",u="mobile",p="tablet",f="smarttv",m={extend:function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r},has:function(e,t){return"string"==typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.replace(/[^\d\.]/g,"").split(".")[0]:void 0},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},h={rgx:function(e,t){for(var r,n,o,a,i,s,c=0;c<t.length&&!i;){var l=t[c],d=t[c+1];for(r=n=0;r<l.length&&!i;)if(i=l[r++].exec(e))for(o=0;o<d.length;o++)s=i[++n],"object"==typeof(a=d[o])&&a.length>0?2==a.length?"function"==typeof a[1]?this[a[0]]=a[1].call(this,s):this[a[0]]=a[1]:3==a.length?"function"!=typeof a[1]||a[1].exec&&a[1].test?this[a[0]]=s?s.replace(a[1],a[2]):void 0:this[a[0]]=s?a[1].call(this,s,a[2]):void 0:4==a.length&&(this[a[0]]=s?a[3].call(this,s.replace(a[1],a[2])):void 0):this[a]=s||void 0;c+=2}},str:function(e,t){for(var r in t)if("object"==typeof t[r]&&t[r].length>0){for(var n=0;n<t[r].length;n++)if(m.has(t[r][n],e))return"?"===r?void 0:r}else if(m.has(t[r],e))return"?"===r?void 0:r;return e}},g={browser:{oldsafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},b={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[s,d],[/(opios)[\/\s]+([\w\.]+)/i],[[s,"Opera Mini"],d],[/\s(opr)\/([\w\.]+)/i],[[s,"Opera"],d],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim)(?:browser)?[\/\s]?([\w\.]*)/i,/(bidubrowser|baidubrowser)[\/\s]?([\w\.]+)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]*)/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\/([\w\.-]+)/i],[s,d],[/(konqueror)\/([\w\.]+)/i],[[s,"Konqueror"],d],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[s,"IE"],d],[/(edge|edgios|edga|edg)\/((\d+)?[\w\.]+)/i],[[s,"Edge"],d],[/(yabrowser)\/([\w\.]+)/i],[[s,"Yandex"],d],[/(Avast)\/([\w\.]+)/i],[[s,"Avast Secure Browser"],d],[/(AVG)\/([\w\.]+)/i],[[s,"AVG Secure Browser"],d],[/(puffin)\/([\w\.]+)/i],[[s,"Puffin"],d],[/(focus)\/([\w\.]+)/i],[[s,"Firefox Focus"],d],[/(opt)\/([\w\.]+)/i],[[s,"Opera Touch"],d],[/((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[[s,"UCBrowser"],d],[/(comodo_dragon)\/([\w\.]+)/i],[[s,/_/g," "],d],[/(windowswechat qbcore)\/([\w\.]+)/i],[[s,"WeChat(Win) Desktop"],d],[/(micromessenger)\/([\w\.]+)/i],[[s,"WeChat"],d],[/(brave)\/([\w\.]+)/i],[[s,"Brave"],d],[/(qqbrowserlite)\/([\w\.]+)/i],[s,d],[/(QQ)\/([\d\.]+)/i],[s,d],[/m?(qqbrowser)[\/\s]?([\w\.]+)/i],[s,d],[/(baiduboxapp)[\/\s]?([\w\.]+)/i],[s,d],[/(2345Explorer)[\/\s]?([\w\.]+)/i],[s,d],[/(MetaSr)[\/\s]?([\w\.]+)/i],[s],[/(LBBROWSER)/i],[s],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[d,[s,"MIUI Browser"]],[/;fbav\/([\w\.]+);/i],[d,[s,"Facebook"]],[/safari\s(line)\/([\w\.]+)/i,/android.+(line)\/([\w\.]+)\/iab/i],[s,d],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[d,[s,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[s,/(.+)/,"$1 WebView"],d],[/((?:oculus|samsung)browser)\/([\w\.]+)/i],[[s,/(.+(?:g|us))(.+)/,"$1 $2"],d],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i],[d,[s,"Android Browser"]],[/(sailfishbrowser)\/([\w\.]+)/i],[[s,"Sailfish Browser"],d],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[s,d],[/(dolfin)\/([\w\.]+)/i],[[s,"Dolphin"],d],[/(qihu|qhbrowser|qihoobrowser|360browser)/i],[[s,"360 Browser"]],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[s,"Chrome"],d],[/(coast)\/([\w\.]+)/i],[[s,"Opera Coast"],d],[/fxios\/([\w\.-]+)/i],[d,[s,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[d,[s,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[d,s],[/webkit.+?(gsa)\/([\w\.]+).+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[[s,"GSA"],d],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[s,[d,h.str,g.browser.oldsafari.version]],[/(webkit|khtml)\/([\w\.]+)/i],[s,d],[/(navigator|netscape)\/([\w\.-]+)/i],[[s,"Netscape"],d],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(moLine truncated
|
||||
*/!function(o,a){"use strict";var i="model",s="name",c="type",l="vendor",d="version",u="mobile",p="tablet",f="smarttv",m={extend:function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r},has:function(e,t){return"string"==typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.replace(/[^\d\.]/g,"").split(".")[0]:void 0},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},h={rgx:function(e,t){for(var r,n,o,a,i,s,c=0;c<t.length&&!i;){var l=t[c],d=t[c+1];for(r=n=0;r<l.length&&!i;)if(i=l[r++].exec(e))for(o=0;o<d.length;o++)s=i[++n],"object"==typeof(a=d[o])&&a.length>0?2==a.length?"function"==typeof a[1]?this[a[0]]=a[1].call(this,s):this[a[0]]=a[1]:3==a.length?"function"!=typeof a[1]||a[1].exec&&a[1].test?this[a[0]]=s?s.replace(a[1],a[2]):void 0:this[a[0]]=s?a[1].call(this,s,a[2]):void 0:4==a.length&&(this[a[0]]=s?a[3].call(this,s.replace(a[1],a[2])):void 0):this[a]=s||void 0;c+=2}},str:function(e,t){for(var r in t)if("object"==typeof t[r]&&t[r].length>0){for(var n=0;n<t[r].length;n++)if(m.has(t[r][n],e))return"?"===r?void 0:r}else if(m.has(t[r],e))return"?"===r?void 0:r;return e}},g={browser:{oldsafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},b={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[s,d],[/(opios)[\/\s]+([\w\.]+)/i],[[s,"Opera Mini"],d],[/\s(opr)\/([\w\.]+)/i],[[s,"Opera"],d],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim)(?:browser)?[\/\s]?([\w\.]*)/i,/(bidubrowser|baidubrowser)[\/\s]?([\w\.]+)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]*)/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\/([\w\.-]+)/i],[s,d],[/(konqueror)\/([\w\.]+)/i],[[s,"Konqueror"],d],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[s,"IE"],d],[/(edge|edgios|edga|edg)\/((\d+)?[\w\.]+)/i],[[s,"Edge"],d],[/(yabrowser)\/([\w\.]+)/i],[[s,"Yandex"],d],[/(Avast)\/([\w\.]+)/i],[[s,"Avast Secure Browser"],d],[/(AVG)\/([\w\.]+)/i],[[s,"AVG Secure Browser"],d],[/(puffin)\/([\w\.]+)/i],[[s,"Puffin"],d],[/(focus)\/([\w\.]+)/i],[[s,"Firefox Focus"],d],[/(opt)\/([\w\.]+)/i],[[s,"Opera Touch"],d],[/((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[[s,"UCBrowser"],d],[/(comodo_dragon)\/([\w\.]+)/i],[[s,/_/g," "],d],[/(windowswechat qbcore)\/([\w\.]+)/i],[[s,"WeChat(Win) Desktop"],d],[/(micromessenger)\/([\w\.]+)/i],[[s,"WeChat"],d],[/(brave)\/([\w\.]+)/i],[[s,"Brave"],d],[/(qqbrowserlite)\/([\w\.]+)/i],[s,d],[/(QQ)\/([\d\.]+)/i],[s,d],[/m?(qqbrowser)[\/\s]?([\w\.]+)/i],[s,d],[/(baiduboxapp)[\/\s]?([\w\.]+)/i],[s,d],[/(2345Explorer)[\/\s]?([\w\.]+)/i],[s,d],[/(MetaSr)[\/\s]?([\w\.]+)/i],[s],[/(LBBROWSER)/i],[s],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[d,[s,"MIUI Browser"]],[/;fbav\/([\w\.]+);/i],[d,[s,"Facebook"]],[/safari\s(line)\/([\w\.]+)/i,/android.+(line)\/([\w\.]+)\/iab/i],[s,d],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[d,[s,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[s,/(.+)/,"$1 WebView"],d],[/((?:oculus|samsung)browser)\/([\w\.]+)/i],[[s,/(.+(?:g|us))(.+)/,"$1 $2"],d],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i],[d,[s,"Android Browser"]],[/(sailfishbrowser)\/([\w\.]+)/i],[[s,"Sailfish Browser"],d],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[s,d],[/(dolfin)\/([\w\.]+)/i],[[s,"Dolphin"],d],[/(qihu|qhbrowser|qihoobrowser|360browser)/i],[[s,"360 Browser"]],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[s,"Chrome"],d],[/(coast)\/([\w\.]+)/i],[[s,"Opera Coast"],d],[/fxios\/([\w\.-]+)/i],[d,[s,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[d,[s,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[d,s],[/webkit.+?(gsa)\/([\w\.]+).+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[[s,"GSA"],d],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[s,[d,h.str,g.browser.oldsafari.version]],[/(webkit|khtml)\/([\w\.]+)/i],[s,d],[/(navigator|netscape)\/([\w\.-]+)/i],[[s,"Netscape"],d],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(moLine truncated
|
||||
Reference in new issue
Block a user