google-chrome

CSS max-width has inaccurate pixel precision

北战南征 提交于 2021-01-02 12:55:20
问题 I have an issue with max-width media rule. I test to hide the elements on different max-width values and the behavior is inconsistent. I have tested 4 scenarios varying in the screen width. Scenario 1 : Screen width is 638px: This matches my expectation. Scenario 2 : Screen width is 639px: This is wrong! I expect column639 still to be hidden! Scenario 3 : Screen width is 640px: This matches my expectation. Scenario 4 : Screen width is 641px: This matches my expectation. Question: What causes

CSS max-width has inaccurate pixel precision

こ雲淡風輕ζ 提交于 2021-01-02 12:55:06
问题 I have an issue with max-width media rule. I test to hide the elements on different max-width values and the behavior is inconsistent. I have tested 4 scenarios varying in the screen width. Scenario 1 : Screen width is 638px: This matches my expectation. Scenario 2 : Screen width is 639px: This is wrong! I expect column639 still to be hidden! Scenario 3 : Screen width is 640px: This matches my expectation. Scenario 4 : Screen width is 641px: This matches my expectation. Question: What causes

CSS max-width has inaccurate pixel precision

不羁的心 提交于 2021-01-02 12:53:50
问题 I have an issue with max-width media rule. I test to hide the elements on different max-width values and the behavior is inconsistent. I have tested 4 scenarios varying in the screen width. Scenario 1 : Screen width is 638px: This matches my expectation. Scenario 2 : Screen width is 639px: This is wrong! I expect column639 still to be hidden! Scenario 3 : Screen width is 640px: This matches my expectation. Scenario 4 : Screen width is 641px: This matches my expectation. Question: What causes

Save json to chrome storage / local storage

徘徊边缘 提交于 2021-01-02 06:42:13
问题 I want to save json to chrome or local storage. I also need to be able too add items without losing the others. 回答1: Updated var local = (function(){ var setData = function(key,obj){ var values = JSON.stringify(obj); localStorage.setItem(key,values); } var getData = function(key){ if(localStorage.getItem(key) != null){ return JSON.parse(localStorage.getItem(key)); }else{ return false; } } var updateDate = function(key,newData){ if(localStorage.getItem(key) != null){ var oldData = JSON.parse

issue with cross-site cookies: how to set cookie from backend to frontend

。_饼干妹妹 提交于 2021-01-02 06:09:11
问题 I'm currently developing my first webapp, frontend with React and backend with FastAPI . I'm trying to test it out jointly with Chrome-- see if the frontend makes the correct API calls to backend, and display the results. I've been having problems with cookies, and I'd like help. Apologies in advance for the long post – I've been going through many resources past couple of days, and at this point I'm unsure what's relevant and what's not. Frontend on localhost:8080 Backend on http://127.0.0.1

Make Promise wait for a Chrome.runtime.sendMessage

帅比萌擦擦* 提交于 2021-01-02 05:41:34
问题 I've always seen Promise work with setTimeout, but I'm trying to make it based on whatever the chrome.runtime.sendMessage returns to the Promise. I've got a content script that does this function once the script has been done. chrome.runtime.sendMessage({complete: true}); I've got a background script that loops through every item in an array and uses one of its values to open a URL with chrome.tabs.update. What I'm trying to do is make the async function wait for the Message the content

Make Promise wait for a Chrome.runtime.sendMessage

a 夏天 提交于 2021-01-02 05:38:48
问题 I've always seen Promise work with setTimeout, but I'm trying to make it based on whatever the chrome.runtime.sendMessage returns to the Promise. I've got a content script that does this function once the script has been done. chrome.runtime.sendMessage({complete: true}); I've got a background script that loops through every item in an array and uses one of its values to open a URL with chrome.tabs.update. What I'm trying to do is make the async function wait for the Message the content

background.html vs. background.js - chrome extension

六眼飞鱼酱① 提交于 2021-01-02 05:22:33
问题 I am really confused here. I am trying to understand the file architecture of chrome extension. I am reading this doc: https://developer.chrome.com/extensions/overview#arch My situation: I want to setup the oauth flow so that user can log in inside the extension (the other endpoint is my django backend). Till now, I have these files: background.js content.js popup.html manifest.json where my content.js sends message to background.js and gets response back. so far so fine! But now while

How do I check if the opened cross domain window is ready to receive postmessage?

戏子无情 提交于 2021-01-01 06:25:25
问题 I launch a URL from another domain and then postMessage to it const child = window.open("http://urlfromanotherdomain.com"); child.postMessage("you cant handle the message", "*"); The JavaScript code, in the child window I launch, registers its interest as follows: window.onmessage = function(ev) {window.console.log(ev);} The problem is that sometimes there's so much code to run in the child window before it's able to register interest that it doesn't receive the posted message. How do I

Difference between XTestFakeButtonEvent & XSendEvent

心已入冬 提交于 2020-12-31 05:12:45
问题 I'm trying to write simple mouse clicker for ubuntu via x11. For first i wrote first variant (based on XSendEvent) of clicking procedure: #include <unistd.h> #include <X11/Xlib.h> #include <X11/Xutil.h> void mouseClick(int button) { Display *display = XOpenDisplay(NULL); XEvent event; if(display == NULL) { std::cout << "clicking error 0" << std::endl; exit(EXIT_FAILURE); } memset(&event, 0x00, sizeof(event)); event.type = ButtonPress; event.xbutton.button = button; event.xbutton.same_screen =