detect microsoft edge
This commit is contained in:
@@ -109,6 +109,15 @@ beef.browser = {
|
|||||||
return !!window.XMLHttpRequest && !window.chrome && !window.opera && !!document.documentMode && !!window.performance && typeof navigator.msMaxTouchPoints !== "undefined" && typeof document.selection === "undefined" && typeof document.createStyleSheet === "undefined" && typeof window.createPopup === "undefined" && typeof window.XDomainRequest === "undefined";
|
return !!window.XMLHttpRequest && !window.chrome && !window.opera && !!document.documentMode && !!window.performance && typeof navigator.msMaxTouchPoints !== "undefined" && typeof document.selection === "undefined" && typeof document.createStyleSheet === "undefined" && typeof window.createPopup === "undefined" && typeof window.XDomainRequest === "undefined";
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Returns true if Edge.
|
||||||
|
* @example: beef.browser.isEdge()
|
||||||
|
*/
|
||||||
|
isEdge: function () {
|
||||||
|
return !beef.browser.isIE() && !!window.StyleMedia;
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if IE.
|
* Returns true if IE.
|
||||||
* @example: beef.browser.isIE()
|
* @example: beef.browser.isIE()
|
||||||
@@ -1261,7 +1270,7 @@ beef.browser = {
|
|||||||
isC51iOS: function () {
|
isC51iOS: function () {
|
||||||
return (!window.webkitPerformance && window.navigator.appVersion.match(/CriOS\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/CriOS\/(\d+)\./)[1], 10) == 51) ? true : false);
|
return (!window.webkitPerformance && window.navigator.appVersion.match(/CriOS\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/CriOS\/(\d+)\./)[1], 10) == 51) ? true : false);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if Chrome 52.
|
* Returns true if Chrome 52.
|
||||||
* @example: beef.browser.isC52()
|
* @example: beef.browser.isC52()
|
||||||
@@ -1269,15 +1278,15 @@ beef.browser = {
|
|||||||
isC52: function () {
|
isC52: function () {
|
||||||
return (!!window.chrome && !!window.fetch && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 52) ? true : false);
|
return (!!window.chrome && !!window.fetch && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 52) ? true : false);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if Chrome for iOS 52.
|
* Returns true if Chrome for iOS 52.
|
||||||
* @example: beef.browser.isC52iOS()
|
* @example: beef.browser.isC52iOS()
|
||||||
*/
|
*/
|
||||||
isC52iOS: function () {
|
isC52iOS: function () {
|
||||||
return (!window.webkitPerformance && window.navigator.appVersion.match(/CriOS\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/CriOS\/(\d+)\./)[1], 10) == 52) ? true : false);
|
return (!window.webkitPerformance && window.navigator.appVersion.match(/CriOS\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/CriOS\/(\d+)\./)[1], 10) == 52) ? true : false);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if Chrome 53.
|
* Returns true if Chrome 53.
|
||||||
* @example: beef.browser.isC53()
|
* @example: beef.browser.isC53()
|
||||||
@@ -1285,7 +1294,7 @@ beef.browser = {
|
|||||||
isC53: function () {
|
isC53: function () {
|
||||||
return (!!window.chrome && !!window.fetch && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 53) ? true : false);
|
return (!!window.chrome && !!window.fetch && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 53) ? true : false);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if Chrome for iOS 53.
|
* Returns true if Chrome for iOS 53.
|
||||||
* @example: beef.browser.isC53iOS()
|
* @example: beef.browser.isC53iOS()
|
||||||
@@ -1293,7 +1302,7 @@ beef.browser = {
|
|||||||
isC53iOS: function () {
|
isC53iOS: function () {
|
||||||
return (!window.webkitPerformance && window.navigator.appVersion.match(/CriOS\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/CriOS\/(\d+)\./)[1], 10) == 53) ? true : false);
|
return (!window.webkitPerformance && window.navigator.appVersion.match(/CriOS\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/CriOS\/(\d+)\./)[1], 10) == 53) ? true : false);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if Chrome 54.
|
* Returns true if Chrome 54.
|
||||||
* @example: beef.browser.isC54()
|
* @example: beef.browser.isC54()
|
||||||
@@ -1301,15 +1310,15 @@ beef.browser = {
|
|||||||
isC54: function () {
|
isC54: function () {
|
||||||
return (!!window.chrome && !!window.fetch && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 54) ? true : false);
|
return (!!window.chrome && !!window.fetch && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 54) ? true : false);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if Chrome for iOS 54.
|
* Returns true if Chrome for iOS 54.
|
||||||
* @example: beef.browser.isC54iOS()
|
* @example: beef.browser.isC54iOS()
|
||||||
*/
|
*/
|
||||||
isC54iOS: function () {
|
isC54iOS: function () {
|
||||||
return (!window.webkitPerformance && window.navigator.appVersion.match(/CriOS\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/CriOS\/(\d+)\./)[1], 10) == 54) ? true : false);
|
return (!window.webkitPerformance && window.navigator.appVersion.match(/CriOS\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/CriOS\/(\d+)\./)[1], 10) == 54) ? true : false);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if Chrome 55.
|
* Returns true if Chrome 55.
|
||||||
* @example: beef.browser.isC55()
|
* @example: beef.browser.isC55()
|
||||||
@@ -1317,15 +1326,15 @@ beef.browser = {
|
|||||||
isC55: function () {
|
isC55: function () {
|
||||||
return (!!window.chrome && !!window.fetch && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 55) ? true : false);
|
return (!!window.chrome && !!window.fetch && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 55) ? true : false);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if Chrome for iOS 55.
|
* Returns true if Chrome for iOS 55.
|
||||||
* @example: beef.browser.isC55iOS()
|
* @example: beef.browser.isC55iOS()
|
||||||
*/
|
*/
|
||||||
isC55iOS: function () {
|
isC55iOS: function () {
|
||||||
return (!window.webkitPerformance && window.navigator.appVersion.match(/CriOS\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/CriOS\/(\d+)\./)[1], 10) == 55) ? true : false);
|
return (!window.webkitPerformance && window.navigator.appVersion.match(/CriOS\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/CriOS\/(\d+)\./)[1], 10) == 55) ? true : false);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if Chrome 56.
|
* Returns true if Chrome 56.
|
||||||
* @example: beef.browser.isC56()
|
* @example: beef.browser.isC56()
|
||||||
@@ -1333,7 +1342,7 @@ beef.browser = {
|
|||||||
isC56: function () {
|
isC56: function () {
|
||||||
return (!!window.chrome && !!window.fetch && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 56) ? true : false);
|
return (!!window.chrome && !!window.fetch && !window.webkitPerformance && window.navigator.appVersion.match(/Chrome\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) == 56) ? true : false);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if Chrome for iOS 56.
|
* Returns true if Chrome for iOS 56.
|
||||||
* @example: beef.browser.isC56iOS()
|
* @example: beef.browser.isC56iOS()
|
||||||
@@ -1341,7 +1350,7 @@ beef.browser = {
|
|||||||
isC56iOS: function () {
|
isC56iOS: function () {
|
||||||
return (!window.webkitPerformance && window.navigator.appVersion.match(/CriOS\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/CriOS\/(\d+)\./)[1], 10) == 56) ? true : false);
|
return (!window.webkitPerformance && window.navigator.appVersion.match(/CriOS\/(\d+)\./)) && ((parseInt(window.navigator.appVersion.match(/CriOS\/(\d+)\./)[1], 10) == 56) ? true : false);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if Chrome 57.
|
* Returns true if Chrome 57.
|
||||||
* @example: beef.browser.isC57()
|
* @example: beef.browser.isC57()
|
||||||
@@ -1546,7 +1555,6 @@ beef.browser = {
|
|||||||
C57iOS: this.isC57iOS(), // Chrome 57 on iOS
|
C57iOS: this.isC57iOS(), // Chrome 57 on iOS
|
||||||
C58: this.isC58(), // Chrome 58
|
C58: this.isC58(), // Chrome 58
|
||||||
C58iOS: this.isC58iOS(), // Chrome 58 on iOS
|
C58iOS: this.isC58iOS(), // Chrome 58 on iOS
|
||||||
|
|
||||||
C: this.isC(), // Chrome any version
|
C: this.isC(), // Chrome any version
|
||||||
|
|
||||||
FF2: this.isFF2(), // Firefox 2
|
FF2: this.isFF2(), // Firefox 2
|
||||||
@@ -2016,7 +2024,7 @@ beef.browser = {
|
|||||||
}
|
}
|
||||||
; // Chrome 58 for iOS
|
; // Chrome 58 for iOS
|
||||||
|
|
||||||
|
|
||||||
if (this.isFF2()) {
|
if (this.isFF2()) {
|
||||||
return '2'
|
return '2'
|
||||||
}
|
}
|
||||||
@@ -2267,6 +2275,11 @@ beef.browser = {
|
|||||||
}
|
}
|
||||||
; // Internet Explorer 11
|
; // Internet Explorer 11
|
||||||
|
|
||||||
|
if (this.isEdge()) {
|
||||||
|
return '1'
|
||||||
|
}
|
||||||
|
; // Microsoft Edge
|
||||||
|
|
||||||
if (this.isS4()) {
|
if (this.isS4()) {
|
||||||
return '4'
|
return '4'
|
||||||
}
|
}
|
||||||
@@ -2333,6 +2346,10 @@ beef.browser = {
|
|||||||
return 'IE'
|
return 'IE'
|
||||||
}
|
}
|
||||||
; // Internet Explorer any version
|
; // Internet Explorer any version
|
||||||
|
if (this.isEdge()) {
|
||||||
|
return 'E'
|
||||||
|
}
|
||||||
|
; // Microsoft Edge any version
|
||||||
if (this.isO()) {
|
if (this.isO()) {
|
||||||
return 'O'
|
return 'O'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ module Constants
|
|||||||
FF = 'FF' # Firefox
|
FF = 'FF' # Firefox
|
||||||
M = 'M' # Mozilla
|
M = 'M' # Mozilla
|
||||||
IE = 'IE' # Internet Explorer
|
IE = 'IE' # Internet Explorer
|
||||||
|
E = 'E' # Microsoft Edge
|
||||||
S = 'S' # Safari
|
S = 'S' # Safari
|
||||||
K = 'K' # Konqueror
|
K = 'K' # Konqueror
|
||||||
C = 'C' # Chrome
|
C = 'C' # Chrome
|
||||||
@@ -27,6 +28,7 @@ module Constants
|
|||||||
FRIENDLY_FF_NAME = 'Firefox'
|
FRIENDLY_FF_NAME = 'Firefox'
|
||||||
FRIENDLY_M_NAME = 'Mozilla'
|
FRIENDLY_M_NAME = 'Mozilla'
|
||||||
FRIENDLY_IE_NAME = 'Internet Explorer'
|
FRIENDLY_IE_NAME = 'Internet Explorer'
|
||||||
|
FRIENDLY_E_NAME = 'Microsoft Edge'
|
||||||
FRIENDLY_S_NAME = 'Safari'
|
FRIENDLY_S_NAME = 'Safari'
|
||||||
FRIENDLY_K_NAME = 'Konqueror'
|
FRIENDLY_K_NAME = 'Konqueror'
|
||||||
FRIENDLY_C_NAME = 'Chrome'
|
FRIENDLY_C_NAME = 'Chrome'
|
||||||
@@ -46,6 +48,7 @@ module Constants
|
|||||||
when FF; return FRIENDLY_FF_NAME
|
when FF; return FRIENDLY_FF_NAME
|
||||||
when M ; return FRIENDLY_M_NAME
|
when M ; return FRIENDLY_M_NAME
|
||||||
when IE; return FRIENDLY_IE_NAME
|
when IE; return FRIENDLY_IE_NAME
|
||||||
|
when E ; return FRIENDLY_E_NAME
|
||||||
when S ; return FRIENDLY_S_NAME
|
when S ; return FRIENDLY_S_NAME
|
||||||
when K ; return FRIENDLY_K_NAME
|
when K ; return FRIENDLY_K_NAME
|
||||||
when C ; return FRIENDLY_C_NAME
|
when C ; return FRIENDLY_C_NAME
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ module Models
|
|||||||
browser = get(session_id, 'BrowserName')
|
browser = get(session_id, 'BrowserName')
|
||||||
|
|
||||||
return BeEF::Extension::AdminUI::Constants::Agents::AGENT_IE_IMG if browser.eql? 'IE' # Internet Explorer
|
return BeEF::Extension::AdminUI::Constants::Agents::AGENT_IE_IMG if browser.eql? 'IE' # Internet Explorer
|
||||||
|
return BeEF::Extension::AdminUI::Constants::Agents::AGENT_EDGE_IMG if browser.eql? 'E' # Microsoft Edge
|
||||||
return BeEF::Extension::AdminUI::Constants::Agents::AGENT_FIREFOX_IMG if browser.eql? 'FF' # Firefox
|
return BeEF::Extension::AdminUI::Constants::Agents::AGENT_FIREFOX_IMG if browser.eql? 'FF' # Firefox
|
||||||
return BeEF::Extension::AdminUI::Constants::Agents::AGENT_SAFARI_IMG if browser.eql? 'S' # Safari
|
return BeEF::Extension::AdminUI::Constants::Agents::AGENT_SAFARI_IMG if browser.eql? 'S' # Safari
|
||||||
return BeEF::Extension::AdminUI::Constants::Agents::AGENT_CHROME_IMG if browser.eql? 'C' # Chrome
|
return BeEF::Extension::AdminUI::Constants::Agents::AGENT_CHROME_IMG if browser.eql? 'C' # Chrome
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ module Models
|
|||||||
|
|
||||||
return BeEF::Extension::AdminUI::Constants::Agents::AGENT_UNKNOWN_IMG if agent.nil?
|
return BeEF::Extension::AdminUI::Constants::Agents::AGENT_UNKNOWN_IMG if agent.nil?
|
||||||
return BeEF::Extension::AdminUI::Constants::Agents::AGENT_IE_IMG if agent.include? BeEF::Extension::AdminUI::Constants::Agents::AGENT_IE_UA_STR
|
return BeEF::Extension::AdminUI::Constants::Agents::AGENT_IE_IMG if agent.include? BeEF::Extension::AdminUI::Constants::Agents::AGENT_IE_UA_STR
|
||||||
|
return BeEF::Extension::AdminUI::Constants::Agents::AGENT_EDGE_IMG if agent.include? BeEF::Extension::AdminUI::Constants::Agents::AGENT_EDGE_UA_STR
|
||||||
return BeEF::Extension::AdminUI::Constants::Agents::AGENT_FIREFOX_IMG if agent.include? BeEF::Extension::AdminUI::Constants::Agents::AGENT_FIREFOX_UA_STR
|
return BeEF::Extension::AdminUI::Constants::Agents::AGENT_FIREFOX_IMG if agent.include? BeEF::Extension::AdminUI::Constants::Agents::AGENT_FIREFOX_UA_STR
|
||||||
return BeEF::Extension::AdminUI::Constants::Agents::AGENT_MOZILLA_IMG if agent.include? BeEF::Extension::AdminUI::Constants::Agents::AGENT_MOZILLA_UA_STR
|
return BeEF::Extension::AdminUI::Constants::Agents::AGENT_MOZILLA_IMG if agent.include? BeEF::Extension::AdminUI::Constants::Agents::AGENT_MOZILLA_UA_STR
|
||||||
return BeEF::Extension::AdminUI::Constants::Agents::AGENT_SAFARI_IMG if agent.include? BeEF::Extension::AdminUI::Constants::Agents::AGENT_SAFARI_UA_STR
|
return BeEF::Extension::AdminUI::Constants::Agents::AGENT_SAFARI_IMG if agent.include? BeEF::Extension::AdminUI::Constants::Agents::AGENT_SAFARI_UA_STR
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ module Constants
|
|||||||
AGENT_MOZILLA_IMG = 'mozilla.png'
|
AGENT_MOZILLA_IMG = 'mozilla.png'
|
||||||
AGENT_IE_UA_STR = 'MSIE'
|
AGENT_IE_UA_STR = 'MSIE'
|
||||||
AGENT_IE_IMG = 'msie.png'
|
AGENT_IE_IMG = 'msie.png'
|
||||||
|
AGENT_EDGE_UA_STR = 'Edge'
|
||||||
|
AGENT_EDGE_IMG = 'edge.png'
|
||||||
AGENT_SAFARI_UA_STR = 'Safari'
|
AGENT_SAFARI_UA_STR = 'Safari'
|
||||||
AGENT_SAFARI_IMG = 'safari.png'
|
AGENT_SAFARI_IMG = 'safari.png'
|
||||||
AGENT_KONQ_UA_STR = 'Konqueror'
|
AGENT_KONQ_UA_STR = 'Konqueror'
|
||||||
|
|||||||
BIN
extensions/admin_ui/media/images/icons/edge.png
Normal file
BIN
extensions/admin_ui/media/images/icons/edge.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.0 KiB |
Reference in New Issue
Block a user