Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Basic Edge support #9

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
21 changes: 12 additions & 9 deletions background_scripts/main.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -324,15 +324,18 @@ Frames =
enabledState = Exclusions.isEnabledForUrl request.url

if request.frameIsFocused
chrome.browserAction.setIcon? tabId: tabId, imageData: do ->
enabledStateIcon =
if not enabledState.isEnabledForUrl
DISABLED_ICON
else if 0 < enabledState.passKeys.length
PARTIAL_ICON
else
ENABLED_ICON
iconImageData[enabledStateIcon]
enabledStateIcon =
if not enabledState.isEnabledForUrl
DISABLED_ICON
else if 0 < enabledState.passKeys.length
PARTIAL_ICON
else
ENABLED_ICON
if Utils.isChrome()
iconInfo = tabId: tabId, imageData: iconImageData[enabledStateIcon]
else
iconInfo = tabId: tabId, path: enabledStateIcon
chrome.browserAction.setIcon? iconInfo

port.postMessage extend request, enabledState

Expand Down
2 changes: 1 addition & 1 deletion lib/dom_utils.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ DomUtils =
eventSequence = ["mouseover", "mousedown", "mouseup", "click"]
for event in eventSequence
defaultActionShouldTrigger = @simulateMouseEvent event, element, modifiers
if event == "click" and defaultActionShouldTrigger and Utils.isFirefox()
if event == "click" and defaultActionShouldTrigger and not Utils.isChrome()
# Firefox doesn't (currently) trigger the default action for modified keys.
DomUtils.simulateClickDefaultAction element, modifiers
defaultActionShouldTrigger # return the values returned by each @simulateMouseEvent call.
Expand Down
Loading