mirror of
https://github.com/zero-peak/ZeroOmega.git
synced 2025-01-22 15:08:12 -05:00
Compatible with Arc browser
This commit is contained in:
parent
815e162640
commit
962bc129cd
@ -1,7 +1,7 @@
|
||||
{
|
||||
"manifest_version": 3,
|
||||
"name": "ZeroOmega--Proxy Switchy manifest v3 version",
|
||||
"version": "3.2.1",
|
||||
"version": "3.2.2",
|
||||
"description": "__MSG_manifest_app_description__",
|
||||
"icons": {
|
||||
"16": "img/icons/omega-action-16.png",
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"manifest_version": 3,
|
||||
"name": "ZeroOmega--Proxy Switchy manifest v3 version",
|
||||
"version": "3.2.1",
|
||||
"version": "3.2.2",
|
||||
"description": "__MSG_manifest_app_description__",
|
||||
"icons": {
|
||||
"16": "img/icons/omega-action-16.png",
|
||||
@ -20,7 +20,7 @@
|
||||
"32": "img/icons/omega-action-32.png"
|
||||
},
|
||||
"default_title": "__MSG_manifest_icon_default_title__",
|
||||
"default_popup": "popup/index.html"
|
||||
"default_popup": "popup-iframe.html"
|
||||
},
|
||||
"background": {
|
||||
"service_worker": "x-background.js",
|
||||
|
22
omega-target-chromium-extension/overlay/popup-iframe.html
Normal file
22
omega-target-chromium-extension/overlay/popup-iframe.html
Normal file
@ -0,0 +1,22 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title></title>
|
||||
<script src="./lib/iframeResizer/iframeResizer.min.js"></script>
|
||||
<style>
|
||||
html,body{
|
||||
margin: 0;
|
||||
padding:0;
|
||||
}
|
||||
iframe {
|
||||
min-width: 300px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<iframe id="myIframe" src="./popup/index.html" frameborder="0"></iframe>
|
||||
<script src="./lib/script.js/script.min.js"></script>
|
||||
<script src="./popup-iframe.js"></script>
|
||||
</body>
|
||||
</html>
|
14
omega-target-chromium-extension/overlay/popup-iframe.js
Normal file
14
omega-target-chromium-extension/overlay/popup-iframe.js
Normal file
@ -0,0 +1,14 @@
|
||||
|
||||
document.location.href = './popup/index.html'
|
||||
// arc browser can't use location.href to change.
|
||||
// https://github.com/suziwen/ZeroOmega/issues/4
|
||||
$script('js/omega_target_popup.js', 'om-target', function() {
|
||||
$script('popup/js/style.js', 'om-style')
|
||||
iFrameResize({
|
||||
sizeWidth: true,
|
||||
autoResize: true,
|
||||
resizeFrom: 'child',
|
||||
heightCalculationMethod: 'bodyScroll',
|
||||
widthCalculationMethod: 'bodyOffset'
|
||||
}, '#myIframe')
|
||||
})
|
@ -22,7 +22,8 @@ module.exports = class ExternalApi
|
||||
return unless @disabled
|
||||
|
||||
@options.setProxyNotControllable(null)
|
||||
chrome.action.setPopup?({popup: 'popup/index.html'})
|
||||
#chrome.action.setPopup?({popup: 'popup/index.html'})
|
||||
chrome.action.setPopup?({popup: 'popup-iframe.html'})
|
||||
@options.reloadQuickSwitch()
|
||||
@disabled = false
|
||||
@options.clearBadge()
|
||||
@ -49,7 +50,8 @@ module.exports = class ExternalApi
|
||||
if @knownExts[port.sender.id] >= 32
|
||||
reason = 'upgrade'
|
||||
@options.setProxyNotControllable reason, {text: 'X', color: '#5ab432'}
|
||||
chrome.action.setPopup?({popup: 'popup/index.html'})
|
||||
#chrome.action.setPopup?({popup: 'popup/index.html'})
|
||||
chrome.action.setPopup?({popup: 'popup-iframe.html'})
|
||||
port.postMessage({action: 'state', state: 'disabled'})
|
||||
when 'enable'
|
||||
@reenable()
|
||||
|
@ -169,7 +169,8 @@ class ChromeOptions extends OmegaTarget.Options
|
||||
if quickSwitch
|
||||
chrome.action.setPopup({popup: ''})
|
||||
else
|
||||
chrome.action.setPopup({popup: 'popup/index.html'})
|
||||
#chrome.action.setPopup({popup: 'popup/index.html'})
|
||||
chrome.action.setPopup({popup: 'popup-iframe.html'})
|
||||
|
||||
chrome.contextMenus?.update('enableQuickSwitch', {checked: !!quickSwitch})
|
||||
Promise.resolve()
|
||||
|
1305
omega-web/lib/iframeResizer/iframeResizer.contentWindow.min.js
vendored
Normal file
1305
omega-web/lib/iframeResizer/iframeResizer.contentWindow.min.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1466
omega-web/lib/iframeResizer/iframeResizer.min.js
vendored
Normal file
1466
omega-web/lib/iframeResizer/iframeResizer.min.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@ -186,6 +186,7 @@ fieldset[disabled] .form-control {
|
||||
inset: 0;
|
||||
opacity: 0.1;
|
||||
background-color: var(--primaryColor);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.alert-danger {
|
||||
@ -386,13 +387,24 @@ main .page-header {
|
||||
background-color: var(--lighterBackground);
|
||||
}
|
||||
.om-nav-item.om-active > a {
|
||||
color: var(--whiteColor);
|
||||
color: var(--whiteColor)!important;
|
||||
background-color: var(--infoColor);
|
||||
}
|
||||
.om-divider {
|
||||
background-color: var(--lighterBackground);
|
||||
}
|
||||
|
||||
.om-edit-toggle{
|
||||
background-color: var(--defaultBackground);
|
||||
border-color: var(--selectionBackground);
|
||||
color: var(--primaryColor);
|
||||
}
|
||||
|
||||
.om-edit-toggle:hover{
|
||||
background-color: var(--lighterBackground);
|
||||
border-color: var(--highlightBackground);
|
||||
}
|
||||
|
||||
/**
|
||||
* spectrum.css
|
||||
**/
|
||||
|
@ -87,19 +87,19 @@ module.controller 'PopupCtrl', ($scope, $window, $q, omegaTarget,
|
||||
$scope.customCss = customCss
|
||||
|
||||
$scope.closePopup = ->
|
||||
$window.close()
|
||||
$window.top.close()
|
||||
|
||||
$scope.openManage = ->
|
||||
omegaTarget.openManage()
|
||||
$window.close()
|
||||
$window.top.close()
|
||||
|
||||
refreshOnProfileChange = false
|
||||
refresh = ->
|
||||
if refreshOnProfileChange
|
||||
omegaTarget.refreshActivePage().then ->
|
||||
$window.close()
|
||||
$window.top.close()
|
||||
else
|
||||
$window.close()
|
||||
$window.top.close()
|
||||
$scope.profileIcons = profileIcons
|
||||
$scope.dispNameFilter = dispNameFilter
|
||||
$scope.isActive = (profileName) ->
|
||||
@ -123,7 +123,7 @@ module.controller 'PopupCtrl', ($scope, $window, $q, omegaTarget,
|
||||
desc || profile?.name || ''
|
||||
$scope.openOptions = (hash) ->
|
||||
omegaTarget.openOptions(hash).then ->
|
||||
$window.close()
|
||||
$window.top.close()
|
||||
$scope.openConditionHelp = ->
|
||||
pname = encodeURIComponent($scope.currentProfileName)
|
||||
$scope.openOptions("#/profile/#{pname}?help=condition")
|
||||
@ -143,9 +143,9 @@ module.controller 'PopupCtrl', ($scope, $window, $q, omegaTarget,
|
||||
).then(next)
|
||||
|
||||
if apply
|
||||
apply.then -> $window.close()
|
||||
apply.then -> $window.top.close()
|
||||
else
|
||||
$window.close()
|
||||
$window.top.close()
|
||||
|
||||
$scope.tempRuleMenu = {open: false}
|
||||
$scope.nameExternal = {open: false}
|
||||
|
@ -4,8 +4,9 @@
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
padding: 10px;
|
||||
min-width: 180px;
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
body.with-condition-form {
|
||||
|
@ -158,6 +158,7 @@ html(lang='en' ng-app='omegaPopup' ng-controller='PopupCtrl' ng-csp)
|
||||
ng-click='openOptions("#/general")') {{'popup_configureMonitorWebRequests' | tr}}
|
||||
|
||||
script(src='js/log_error.js')
|
||||
script(src='lib/iframeResizer/iframeResizer.contentWindow.min.js')
|
||||
script(src='lib/jquery/jquery.min.js')
|
||||
script(src='lib/angular/angular.min.js')
|
||||
script(src='lib/angular-bootstrap/ui-bootstrap-tpls.min.js')
|
||||
|
@ -17,7 +17,7 @@ html, body {
|
||||
|
||||
body {
|
||||
min-width: 12em;
|
||||
margin: 5px;
|
||||
padding: 5px 0;
|
||||
}
|
||||
|
||||
.om-hidden {
|
||||
@ -33,7 +33,7 @@ body {
|
||||
.om-nav {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
.om-nav-item {
|
||||
|
@ -51,6 +51,7 @@
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<script src="../../lib/iframeResizer/iframeResizer.contentWindow.min.js"></script>
|
||||
<script src="../../lib/script.js/script.min.js"></script>
|
||||
<script src="js/loader.js"></script>
|
||||
</body>
|
||||
|
@ -13,7 +13,7 @@
|
||||
}
|
||||
|
||||
function closePopup() {
|
||||
window.close();
|
||||
window.top.close();
|
||||
// If the popup is opened as a tab, the above won't work. Let's reload then.
|
||||
document.body.style.opacity = 0;
|
||||
setTimeout(function() { history.go(0); }, 300);
|
||||
|
@ -1,6 +1,6 @@
|
||||
(function() {
|
||||
function closePopup() {
|
||||
window.close();
|
||||
window.top.close();
|
||||
// If the popup is opened as a tab, the above won't work. Let's reload then.
|
||||
document.body.style.opacity = 0;
|
||||
setTimeout(function() { history.go(0); }, 300);
|
||||
|
Loading…
Reference in New Issue
Block a user