Skip to content

Commit

Permalink
Add custom home page url - Close #6
Browse files Browse the repository at this point in the history
  • Loading branch information
d3ward committed Sep 4, 2021
1 parent d59883f commit 0b6ddcd
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 17 deletions.
6 changes: 4 additions & 2 deletions src/js/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ function addStyle(css) {
style.innerHTML = css;
head.appendChild(style);
}
var home_url="chrome://newtab";
var scroll_speed=800;
function scrollTo(element, to,duration) {
if (duration <= 0) return;
Expand Down Expand Up @@ -114,7 +115,7 @@ var acDivs = [
ac9: function () {chrome.runtime.sendMessage({chromeURL: "chrome://flags"});},
ac10: function () {chrome.runtime.sendMessage({chromeURL: "chrome://extensions"});},
ac11: function () {chrome.runtime.sendMessage({chromeURL: "chrome://settings"});},
ac12: function () {chrome.runtime.sendMessage({chromeURL: "chrome://newtab"});},
ac12: function () {chrome.runtime.sendMessage({chromeURL: home_url});},
ac13: function () {chrome.runtime.sendMessage({chromeURL: "chrome://history"});},
ac14: function () {chrome.runtime.sendMessage({chromeURL: "view-source:" + window.location.href});},
ac15: function () {window.location.reload();},
Expand All @@ -132,7 +133,7 @@ chrome.storage.local.get({
userActions: [],
fstyle:0,
fpos:0,
options:{"opt0":false,"scroll_speed":800},
options:{"opt0":false,"scroll_speed":800,"home_url":"chrome://newtab"},
pos: ["20px","20px"],
blist:["github.com","youtube.com"],
splist:[1,2,3]
Expand All @@ -147,6 +148,7 @@ chrome.storage.local.get({
let c = items.colors;
let pos=items.pos;
let f=items.fpos;
home_url=items.options["home_url"];
scroll_speed=items.options["scroll_speed"];
const floatly_icon= '<svg width="120" height="50px" viewBox="0 0 375 375" xmlns="http://www.w3.org/2000/svg"><g fill="'+c[1]+'"><path d="M88.145 344.395c.635-.034.01-.016-.016.039 55.687-.237 82.908-79.477 82.156-106.913l-.477-84.963c.504-13.136.047-27.086.047-40.261-33.154-1.467-75.592 31.933-81.458 66.23 0 0 8.747 150.07-.252 165.868z" fill-opacity=".778" /><path d="M90.45 216.65l1.32 58.446c18.794-22.983 48.96-40.274 77.798-44.567 95.996-9.51 95.878-57.47 94.727-76.747-16.568 6.26-56.987-8.573-94.301 0-41.389 8.484-74.504 47.715-79.543 62.868zm208.732-181.1c-21.638 7.432-82.703-11.041-128.245 0-45.542 11.04-88.642 73.618-82.54 142.977 10.616-29.708 59.812-64.162 81.457-66.23 127.386-4.045 128.283-49.094 129.328-76.748z" /></g></svg>';
if(items.style == "fab" && items.fstyle == 0){
Expand Down
13 changes: 8 additions & 5 deletions src/options/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,16 @@ <h2>Colors</h2>
<hr>
<h2>Options</h2>
<label for="opt0">
<span>Hide on scroll</span>
<span>Hide on scroll</span> </label>
<input type="checkbox" id="opt0" class="toggle"></label>
</label>
<label >
Scroll speed in ms for go top/bottom : <span id="scroll_speed_v">10</span>

<label for="scroll_speed">
Scroll speed in ms for go top/bottom : <span id="scroll_speed_v">10</span></label>
<input type="range" id="scroll_speed" value="10" min="0" max="1000">
</label>

<label for="home_url"> Home Page URL</label>
<input type="text" value="chrome://newtab" id="home_url">

<hr>
<h2>Blacklist</h2>
<h3><i>Floatly will not be added in the below domains</i></h3>
Expand Down
19 changes: 9 additions & 10 deletions src/options/options.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0b6ddcd

Please sign in to comment.