Skip to content

Commit

Permalink
Merge pull request #1 from messengerblack/macos11
Browse files Browse the repository at this point in the history
macOS 11 compatibility
  • Loading branch information
ryanmohta authored Dec 23, 2020
2 parents cde621b + b84d9a5 commit 70556ab
Show file tree
Hide file tree
Showing 37 changed files with 95 additions and 2,845 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
xcuserdata/
.DS_Store
1 change: 1 addition & 0 deletions Messenger Black for Safari/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry=https://npm.pkg.github.com/messengerblack
17 changes: 15 additions & 2 deletions Messenger Black for Safari/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,21 @@
<key>SFSafariStyleSheet</key>
<array>
<dict>
<key>Allowed URL Patterns</key>
<array>
<string>https://*.messenger.com/*</string>
<string>https://*.facebook.com/*</string>
</array>
<key>Style Sheet</key>
<string>messengerblack.css</string>
<string>base.css</string>
</dict>
<dict>
<key>Allowed URL Patterns</key>
<array>
<string>https://*.messenger.com/*</string>
</array>
<key>Style Sheet</key>
<string>svg.css</string>
</dict>
</array>
<key>SFSafariToolbarItem</key>
Expand All @@ -60,7 +73,7 @@
<key>Allowed Domains</key>
<array>
<string>*.messenger.com</string>
<string>*.facebook.com/messages</string>
<string>*.facebook.com</string>
</array>
<key>Level</key>
<string>Some</string>
Expand Down
14 changes: 7 additions & 7 deletions Messenger Black for Safari/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ var timerVariable;
document.addEventListener("DOMContentLoaded", initialized);

function initialized() {
safari.extension.dispatchMessage("Initialized");
setTimeout(function(){ safari.extension.dispatchMessage("Initialized"); }, 1000);
}


Expand All @@ -339,10 +339,10 @@ function handleMessage(event) {
function manualChanged(event) {

if(event.message["State"] === "On") {
document.body.classList.add("blackMode");
document.documentElement.classList.add("__fb-dark-mode");
}
else {
document.body.classList.remove("blackMode");
document.documentElement.classList.remove("__fb-dark-mode");
}

clearInterval(timerVariable);
Expand Down Expand Up @@ -387,20 +387,20 @@ function scheduledTimer(startTimeHour, startTimeMinute, endTimeHour, endTimeMinu
if(endTimeHour < startTimeHour || (endTimeHour == startTimeHour && endTimeMinute < startTimeMinute)) {

if(currentHour < endTimeHour || (currentHour == endTimeHour && currentMinute < endTimeMinute) || (currentHour == startTimeHour && currentMinute >= startTimeMinute) || currentHour > startTimeHour) {
document.body.classList.add("blackMode");
document.documentElement.classList.add("__fb-dark-mode");
}
else {
document.body.classList.remove("blackMode");
document.documentElement.classList.remove("__fb-dark-mode");
}

}
else {

if((currentHour > startTimeHour || (currentHour == startTimeHour && currentMinute >= startTimeMinute)) && ((currentHour == endTimeHour && currentMinute < endTimeMinute) || currentHour < endTimeHour)) {
document.body.classList.add("blackMode");
document.documentElement.classList.add("__fb-dark-mode");
}
else {
document.body.classList.remove("blackMode");
document.documentElement.classList.remove("__fb-dark-mode");
}

}
Expand Down
4 changes: 0 additions & 4 deletions Messenger Black for Safari/node_modules/suncalc/.travis.yml

This file was deleted.

22 changes: 0 additions & 22 deletions Messenger Black for Safari/node_modules/suncalc/LICENSE

This file was deleted.

205 changes: 0 additions & 205 deletions Messenger Black for Safari/node_modules/suncalc/README.md

This file was deleted.

Loading

0 comments on commit 70556ab

Please sign in to comment.