logo
down
shadow

Change Color Of SVG toolbar icon in Firefox WebExtension


Change Color Of SVG toolbar icon in Firefox WebExtension

By : PeterEm
Date : November 18 2020, 03:01 PM
help you fix your problem Yes, you can do this in an extension
The browserAction.setIcon() documentation states that the Object which is passed to the method will contain either a path to the icon file within your extension (or an Object containing multiple such paths with different sizes), or an imageData, which is a browserAction.ImageDataType, which is an ImageData (or an Object specifying multiple such items with different sizes):
code :


Share : facebook icon twitter icon
How to change Toolbar home icon color

How to change Toolbar home icon color


By : user3208947
Date : March 29 2020, 07:55 AM
will help you I am using a android.support.v7.widget.Toolbar and learned from this post how to change the color of the hamburger icon to white, but the up/back arrow remains a dark color when I call , I solved it by editing styles.xml:
code :
<style name="ToolbarColoredBackArrow" parent="AppTheme">
    <item name="android:textColorSecondary">INSERT_COLOR_HERE</item>
</style>
<LinearLayout
    android:id="@+id/main_parent_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <android.support.v7.widget.Toolbar
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/toolbar"
        app:theme="@style/ToolbarColoredBackArrow"
        app:popupTheme="@style/AppTheme"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:minHeight="?attr/actionBarSize"
        android:background="?attr/colorPrimary"/>
Change Toolbar overflow icon color

Change Toolbar overflow icon color


By : G. Legra
Date : March 29 2020, 07:55 AM
This might help you I have an android.support.v7.widget Toolbar in my Android app. The background color of this is bright orange and the best looking color on top of this would be white instead of black. , In styles:
code :
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    ...
    <item name="actionOverflowButtonStyle">@style/MyOverflowButtonStyle</item>
</style>

<style name="MyOverflowButtonStyle" parent="Widget.AppCompat.ActionButton.Overflow">
    <item name="android:tint">#62ff00</item>
</style>
Firefox WebExtension toolbar buttons to toggle sidebars

Firefox WebExtension toolbar buttons to toggle sidebars


By : siva kumar reddy
Date : March 29 2020, 07:55 AM
To fix the issue you can do Opening your own sidebar with a browserAction button
You can have a browserAction toolbar button which opens your own sidebar. You can do this by defining both a sidebar_action and a browser_action in your manifest.json.
code :
{
    "manifest_version": 2,
    "name": "Button opens sidebar",
    "description": "Open the sidebar with a toolbar button.",
    "version": "1.0",

    "browser_action": {
        "default_icon": "icon.png",
        "default_title": "Open Sidebar"
    },
    "background": {
        "scripts":[
            "background.js"
        ]
    },
    "sidebar_action": {
        "default_icon": "icon.png",
        "default_title": "Example Sidebar",
        "default_panel": "sidebar.html",
        "open_at_install": false
    }
}
//The manifest.json entry must be a file in your extension, but you can change it to
//  an external site in your background.js:
browser.sidebarAction.setPanel({panel: 'https://example.org/'});
//Open the sidebar when the browserAction button is clicked.
browser.browserAction.onClicked.addListener(() => {
  browser.sidebarAction.open();
});
<html>
  <body>
    <div>Example text</div>
  </body>
</html>
browser.browserAction.onClicked.addListener(() => {
    browser.sidebarAction.isOpen({}).then((isOpen) =>  {
        if (isOpen) {
            browser.sidebarAction.close();
        } else {
            browser.sidebarAction.open();
        }
    });
});
Error: sidebarAction.open may only be called from a user input handler
browser.browserAction.onClicked.addListener(() => {
    browser.sidebarAction.open();
});
browser.browserAction.onClicked.addListener(() => {
    browser.sidebarAction.close();
});
<html>
  <head>
    <script src="sidebar.js"></script>
  </head>
  <body>
    <div>Example text</div>
  </body>
</html>
browser.sidebarAction.setPanel({panel: 'chrome://browser/content/aboutDialog.xul'});
Error: Access denied for URL chrome://browser/content/aboutDialog.xul
How can I change document elements by webExtension when user click on extension icon in toolbar?

How can I change document elements by webExtension when user click on extension icon in toolbar?


By : Marlon Clark
Date : March 29 2020, 07:55 AM
With these it helps Background pages do not have access to the contents of the web page.
You need to use content scripts. Content scripts are injected into the page after page load on idle
code :
"content_scripts": [{
    "matches": ["*://*/*"],
    "js": ["contentscript.js"]
 }]
var elems = document.body.getElementsByTagName("*");  
var re = new RegExp(/abba\b/g);
for (var i = 0; i < elems.length; i++) {
    var str = elems[i].innerHTML;
    if (!str.match(/<[a-zA-Z0-9\s:./\"\'=\\;()-_]*>/) && re.test(str)) {
        var aTag = document.createElement("a");
        aTag.setAttribute('href', "test.php?t=" + str.match(/abba\b/)[0]);
        aTag.setAttribute('target', "_blank");
        aTag.innerHTML = " --**CHANGES**-- ";
        elems[i].appendChild(aTag);
    }
}
browser.browserAction.onClicked.addListener(function(){ 
    browser.tabs.executeScript({file: "/contentscript.js"})
});
Change back icon color in toolbar

Change back icon color in toolbar


By : user1893933
Date : March 29 2020, 07:55 AM
I hope this helps you . I'm using the Android component navigation for a DrawerLayout with NavigationView. , use this style
code :
<style name="ToolbarTheme" parent="@style/ThemeOverlay.AppCompat.ActionBar">
        <!-- Customize color of Toolbar -->
        <item name="colorControlNormal">@color/WhiteColor</item>
    </style>
 <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar_menu"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="#000000"
        android:textColor="#FFF"
        android:textColorPrimary="#FFF"
        app:theme="@style/ToolbarTheme"
        app:layout_constraintTop_toTopOf="parent"
        app:titleTextColor="#FFF"
        app:title="@string/app_name"/>
Related Posts Related Posts :
  • Bootstrap DatePicker format mm/yyyy set max month
  • Firebase cloud firestore + auth: write only for signed in users
  • Getting jQuery.data functionality without jQuery
  • How to get incrementing serial numbers for new and removed items for jQuery sortable?
  • Highlighting a word or sentence in iframe, using javascript/Jquery
  • Calculate what percentage of a specific element has been scrolled into view
  • Knockout autocomplete with jquery doesn't allow to select custom value
  • react native - react-native-maps performance slow on iOS
  • ajax fallback when no internet connection
  • Show Textbox based on RadioButton selection or value when Page Loads
  • JS maximum call stack exceeded
  • Resetting object key values
  • How can i disable the toggle, preventing user to tap/click it?
  • How to include javascript file into LOV popups on apex oracle?
  • Javascript Angular 4 eventEmitter with ngClass
  • Webpack - module not found even though module exists
  • How to display following values using vue js?
  • Regexp: Allow only use of a few words and only once per word
  • CCapture.js webm video blacked out
  • Using a HTML hyperlink to call a JS function on the parent element
  • Return undefined from existing property in javascript model
  • What is the Difference Between These two jQuery Code Snippets?
  • How to get Network Speed in WebRTC
  • How to get text from selected value in a dropdownlist which is js based
  • window is not defined angular universal third library
  • Angularjs ng-repeat stylization depending on previous value
  • Trying to implement Fittext.js
  • Calculate number of match in array Lodash
  • Jquery Smooth Scroll Using Offset.top
  • How to extract data to React state from CSV file using Papa Parse?
  • How to add unique links to google maps markers
  • How to use if condition in a tool bar in java script
  • Ajax filter in django not showing in HTML
  • data collection with Javascript
  • Rotate image on lightbox2 load
  • Prevent body from scrolling when a Pop-Up is open
  • How to copy files that do not need to be compiled in Gulp?
  • Array not assigned to variable? How does this work and what exactly is it doing?
  • Sorting associative array of objects in javascript
  • Changing Icon in Sap.m.tree having CustomTreeItem
  • Merge two array of objects based on a key
  • javascript in css not working
  • Passing only clicked element to onClick function - reactjs
  • React boilerplate doesn't load js files in the index.html
  • is Child service inside child component visible in the Parent component?
  • Check if data attribute value equals a string
  • How to get value of child tag of a button tag
  • How to access subjects of selected mails in Apple Mail using JavaScript?
  • How to get all dynamically set inline-style CSS in jQuery?
  • Error: Module "html" does not provide a view engine (Express)
  • Random Image in <Div> from array
  • Slider with touch function
  • ReactJS Component Architecture Problems / Nested Components or Single Component Manager
  • Javascript: Caching within Closure doesn't work
  • HTM5 Canvas Drawing App: How Do I Select The Color?
  • Assigning Events using HTML DOM
  • html5 getUserMedia() portrait mode
  • How to avoid 'headers already sent' within Promise chain?
  • Get a result from a react native app integrated into an existing android app
  • Why does the value of input field return undefined
  • shadow
    Privacy Policy - Terms - Contact Us © voile276.org