Closed kabir-afk closed 5 months ago
Btw , translate wikibot hasn't changed the pnb.json
file to urdu.json
...should I
add that ?
Btw , translate wikibot hasn't changed the
pnb.json
file tourdu.json
...should I add that ?
Nope, i asked Translatewiki, they will guide us.
Well L201-210 relied on signlanguages
which further relied on the getSignLanguagesWithVideos
function, which has an API endpoint issue. So I commented it out in order to proceed forward, otherwise it would have been stuck there the whole time
Changes Made:
Description
While first 2 changes are minor , I would like to elaborate on the 3rd and 4th ones. Apparently we borrowed some functions from
background-script.js
, for example:-backgroundPage.normalize
orbackgroundPage.checkActiveTabInjections
. But in Chrome MV3 we cant do such things. In order to mimic this behavior I came across various methods which I am going to discuss down below:-background-script,js
, it is necessary to return after calling the function otherwise it doesn't work. While it works and looks ok , it isn't necessary the best approach since there are segments we cant always send messages for , like here.Different browsers have namespace differences as well as different API function coverage..for example while in FF we can still make use of
_backgroundPage.getBackground()
, but we can't do it in Chrome because of the MV3 limitations. And browser type checking for different browsers isn't certainly scalable or efficient. This is also one of the reasons why above approach is better as it is pretty universal to all the browsers and doesn't require much change.checkActiveTabInjections is not defined
.If we can make this work , then it'll be better overall , no more unnecessary messages and compatible across both
sw.js
andbackground-script.js
. We won't need to change the way messages are received as there will be no messages to begin with. It will also not hinder with the problem mentioned above. Maybe I might have done something wrong but again we should keep trying.JSON.stringify()
)and storing its arguments inside an array , then rebuilding it by parsing it and passing the items inside the functions. Seems a bit bizarre and makes for unnecessary code but if it were to happen , functions would be available wherever needed as they are in local storage.